#CSS Positioning Issue with Box Styles: Badges Not Displaying Correctly on Large Screens

15 messages · Page 1 of 1 (latest)

gusty echo
#

What's wrong with the code below and specifically the Box styles? On mobile the badges are being displayed as expected but on large screen the last badge is not visible and the one before it is half visible. When I remove the styles of the Box everything works as expected but then I don't achieve the desired layout (The container of the badges should be fixed)

codesandbox:
https://codesandbox.io/s/runtime-wood-mcczj6?file=/src/App.tsx

Open this link on a laptop to see the problem:
https://mcczj6.csb.app/

runtime-wood-mcczj6 by markkour95 using @emotion/react, @mantine/carousel, @mantine/core, @mantine/dates, @mantine/dropzone, @mantine/form, @mantine/hooks, @mantine/modals, @mantine/notifications

gusty echo
#

@stark ruin Hey Charlie, can you please help me with this? I tried with ChatGPT but it couldn't find the mistake

stark ruin
# gusty echo <@245232658882232320> Hey Charlie, can you please help me with this? I tried wit...

i tend to just stick with mantine Stack and Group nearly always. i don't bother with doing flex myself

for example if you convert what you've done to use Group and Stack there is no problem:
https://codesandbox.io/s/css-positioning-issue-forked-wpf5gd?file=/src/App.tsx

CSS Positioning Issue Forked by mpyoo using @emotion/react, @mantine/carousel, @mantine/core, @mantine/dates, @mantine/dropzone, @mantine/form, @mantine/hooks, @mantine/modals, @mantine/notifications

gusty echo
stark ruin
#

what do you mean by fixed? they both seem to behave the same for me on desktop

gusty echo
#

If I will apply sx={{position: 'fixed'}}, this horizontal scrolling won't work anymore

stark ruin
#

ScrollArea pos="fixed"

#

actually that might not impact it

gusty echo
#

If you take a look at my codesandbox. You will notice that when we scroll down the container which holds badges stay on top always. But for some reason the horizontal scrolling in the badges container doesn't work on large screens. It works but the last badge is not visible

#

There is something weird. The code in my codesandbox works perfectly on small screens but when it comes to large screens, the last badge is not visible and the one before it is half visible

stark ruin
#

seems like this is broken behaviour of position: fixed

stark ruin
# gusty echo There is something weird. The code in my codesandbox works perfectly on small sc...

tried a lot of things, i don't see an obvious answer

as a hack fix you could set some right margin, it may need to be responsive
https://codesandbox.io/s/css-positioning-issue-forked-wpf5gd?file=/src/App.tsx

CSS Positioning Issue Forked by mpyoo using @emotion/react, @mantine/carousel, @mantine/core, @mantine/dates, @mantine/dropzone, @mantine/form, @mantine/hooks, @mantine/modals, @mantine/notifications