Can't horizontal scroll
Hello guys i have a simple react component, the problem is the "tags" div doesnt go into horizontal overflow it just sticks to the parent's width, i tried so many things but couldnt make it
3 Replies
flex will always try to fit the items inside of the container. maybe overflow-auto will work in this case.
otherwise, could you copy the rendered html to a tailwind playground. that's easier for us
For overflow scroll to work on any axis (x or y), these conditions need to be met:
- Content size should be more than the parent size
- The size of the content shouldn't shrink to fit into the parent (The effect of flex on its children)
- The size (or max size) of the parent would have to be specified to stop the parent from expanding to the content size
-
overflow
on that axis has to be set to either scroll
or auto
So, like @MarkBoots said, add the overflow-auto
.
If that doesn't work, check out the remaining constraintsi just gave up on that design it was not practical but thanks though