Can I allow a Drop to scroll offscreen?
See original GitHub issueExpected Behavior
If I’m using a Drop
on a page that scrolls, and the target
is positioned in a way that would mean the Drop
’s natural layout wouldn’t fit in the viewport (and it is unable to flip), I would expect the Drop
to scroll with the target
and be cut off by the viewport
Actual Behavior
The Drop
gets “squished” by max-height
in an attempt to stay visible. Browsing the docs, it’s not clear whether this is the intended behavior, and/or if there’s a way to prevent/opt out of it. It appears to be a side-effect of the placement code.
URL, screen shot, or Codepen exhibiting the issue
This Codesandbox shows the behavior. When it is scrolled the Drop
attempts to remain onscreen, and I’d like it to retain its layout and simply scroll off the screen
Steps to Reproduce
- In Codesandbox, scroll down
- Notice image is distorted because the
maxHeight
of theDrop
is changing, despite theBox
having its height and width set.
Your Environment
- Grommet version: 2.19.1
- Browser Name and version: Reproduced in Chrome 95 and Firefox 94, expected to repro across browsers
- Operating System and version (desktop or mobile): Mac OS 10.14
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (2 by maintainers)
Top Results From Across the Web
Bootstrap dropdown-menu appearing off-screen when list is ...
The dropdown menu appears correctly for the first few items. However, as soon as I scroll down the list and click the ......
Read more >Drag and Drop: Better to avoid drag-n-drop to offscreen ...
The title scroll to the right appears when an item is dragged. As the user moves the item and the list starts scrolling...
Read more >How To Off-screen With Custom Auto Scroll! - Super Mario ...
We want to play your courses. Let's see your COURSE ID's in the COMMENTS!
Read more >content-visibility: the new CSS property that boosts ... - web.dev
The CSS content-visibility property enables web content rendering performance benefits by skipping rendering of off-screen content.
Read more >Drag'n'Drop with mouse events - The Modern JavaScript Tutorial
Drag'n'Drop is a great interface solution. Taking something and dragging and dropping it is a clear and simple way to do many things, ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Interesting. Looks good to me as well, thanks!
Going to go ahead and mark this as a bug. It doesn’t feel like the Drop should be squishing content like that.
Just an extra note to help narrow down the issue, content isn’t getting squished when the text isn’t dynamic (see this codesandbox example). Seems related to how Drop is calculating it’s height when height is flexible like for an image or dynamically rendered text.