question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can I allow a Drop to scroll offscreen?

See original GitHub issue

Expected 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

image

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.

image

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

  1. In Codesandbox, scroll down
  2. Notice image is distorted because the maxHeight of the Drop is changing, despite the Box 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:closed
  • Created 2 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
chriszamierowskicommented, Apr 19, 2022

Interesting. Looks good to me as well, thanks!

1reaction
jcfilbencommented, Dec 16, 2021

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found