Problem with overflow-x
Hello, i have this custom inputs, but whenever i try to remove flex-wrap and add overflow-x, suddenly i need to scroll inside the filters container which is totally not what i want, i was wondering what is the cause of the issue, and how can i solve it
code: https://codesandbox.io/p/sandbox/z442t7
10 Replies
my intention was to make the filters horizontal scroll for smaller screens
So you want it to have horizontal scrolling, but only at smaller screens?
Could you just have the overflow-x: auto;, and then in a media query, do
flex-wrap: wrap; overflow-x: revert
?the problem is that the overflow creates another container/context that you have to scroll withing, outside the main page

i just tried it and it worked perfectly, thank you
i was wondering what was causing the issue?
If you have an overflow-x: auto, the overflow-y will also become auto, so it can potentially introduce vertical scrolling.
You can't change the overflow in one axis without changing both (unless you use
clip
)alright, but doesnt overflow-x: revert, brings the original structure, how can i still have the horizontal scroll?
if we only have that in the media query, we're only removing it when we also turn on the flex-wrap, so we're basically saying "start wrapping, and go back to handling overflows the original way"
okay, so what if i want the filters to stay on one line always and get rid of the vertical overflow

I tried to look at the sandbox, but looks like it was changed to something else. If you always want it to scroll, it shouldn't be an issue though?