Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Popover2 Regression: ContextMenu2 scrolls to top when context menu is opened in Chrome and Firefox #4979

Closed
mormahr opened this issue Oct 22, 2021 · 1 comment

Comments

@mormahr
Copy link

mormahr commented Oct 22, 2021

Environment

  • Package version(s): @blueprintjs/[email protected], @blueprintjs/[email protected]
  • Operating System: macOS Big Sur 11.6 (20G165)
  • Browser name and version: Chrome 95.0.4638.54 (arm64), Firefox 93.0, Safari 15.0 (16612.1.29.41.4, 16612) [Safari still works]

Code Sandbox

Link to a minimal repro:

https://codesandbox.io/s/blueprint-sandbox-forked-sk3n3 (<- not working with @blueprintjs/[email protected])
https://codesandbox.io/s/blueprint-sandbox-forked-n4ck3 (<- working with @blueprintjs/[email protected])

Steps to reproduce

  1. Use current Firefox or Chrome (see versions above), Safari works as expected
  2. Make browser window small enough that you have to scroll down to the context menu trigger
  3. Right-click to open the context menu

Actual behavior

The viewport will have scrolled up to the top.

Expected behavior

The viewport stays as it is and displays the context menu.

Possible solution

The regression was introduced between @blueprintjs/[email protected] and @blueprintjs/[email protected].
Looking at the commits/diff of popover2 between the releases, maybe it's related to the changes of shouldReturnFocusOnClose? Though the only changed code I saw was handleTargetBlur which (afaik) isn't called during the reproduction.

Blueprint_Popover2_ContextMenu2_scroll_bug.mov
@adidahiya
Copy link
Contributor

essentially a duplicate of #4981

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants