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

[Bug]: The PopoverSurface doesn't close automatically when the Popover is used with closeOnScroll #28938

Closed
2 tasks done
zhangxuan615 opened this issue Aug 22, 2023 · 7 comments

Comments

@zhangxuan615
Copy link

Library

React Components / v9 (@fluentui/react-components)

System Info

System:
    OS: Windows 10 10.0.22621
    CPU: (20) x64 Intel(R) Core(TM) i9-10900X CPU @ 3.70GHz
    Memory: 10.93 GB / 31.80 GB
  Browsers:
    Edge: Spartan (44.22621.2134.0), Chromium (116.0.1938.54)
    Internet Explorer: 11.0.22621.1

Are you reporting Accessibility issue?

None

Reproduction

https://codesandbox.io/s/inspiring-fast-5jm9wc?file=/example.tsx

Bug Description

Actual Behavior

  1. the PopoverSurface doesn't close when scrolling by dragging the scroll bar, not rolling the wheel or by scrolling by typing up/down button on the keyboard.
  2. the PopoverSurface doesn't close once the Popoveronce scrolling outside of Popover trigger and keep scrolling.
    steps to repro:
    2.1. click the trigger to open the PopoverSurface. (keep the mouse hover on the trigger)
    2.2. scroll the wheel of mouse coninously to drive the cursor walking away from the trigger.
    2.3. you can still see the PopoverSurface open when you stop scrolling although the PopoverSurface was supposed to be closed.

Expected Behavior

both should close PopoverSurface

Logs

No response

Requested priority

High

Products/sites affected

No response

Are you willing to submit a PR to fix?

no

Validations

  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • The provided reproduction is a minimal reproducible example of the bug.
@YuanboXue-Amber
Copy link
Contributor

YuanboXue-Amber commented Aug 23, 2023

I'm investigating this

@layershifter
Copy link
Member

layershifter commented Sep 4, 2023

May be fixed by #28938.

@zhangxuan615 zhangxuan615 changed the title [Bug]: The PopoverSurface doesn't close aquatically when the Popover is used with closeOnScroll [Bug]: The PopoverSurface doesn't close automatically when the Popover is used with closeOnScroll Sep 4, 2023
@zhangxuan615
Copy link
Author

May be fixed by #28938.

could you give more details about the fix?

@YuanboXue-Amber
Copy link
Contributor

@zhangxuan615 both bugs in this issue are fixed by #29062. This is a new codesandbox built from the latest release, could you verify that it fixes your issues? https://codesandbox.io/s/dreamy-hooks-9zv3g5?file=/example.tsx

@YuanboXue-Amber
Copy link
Contributor

Reopening this issue as previous fix #29062 was reverted #29412.

The original issue is that dragging scrollbar does not close Popover with closeOnScroll.

To close popover on dragging scrollbar, #29412 tries to listen to scroll event because when dragging scrollbar, document receives below events:
image.
But it is reverted in #29412 because changing focus can cause scroll, and we want popover to stay open in this case.

Because this issue has not had activity for over 150 days, we're automatically closing it for house-keeping purposes.

Still require assistance? Please, create a new issue with up-to date details.

@microsoft-github-policy-service microsoft-github-policy-service bot added the Resolution: Soft Close Soft closing inactive issues over a certain period label Mar 3, 2024
@layershifter layershifter removed the Resolution: Soft Close Soft closing inactive issues over a certain period label Mar 4, 2024
@layershifter layershifter reopened this Mar 4, 2024
@YuanboXue-Amber
Copy link
Contributor

Currently, there's no reliable method to accurately decide if the scrollbar is being dragged. Given this limitation, which stems from the current capabilities of web browsers, I'm closing this issue. We are open to revisiting this issue if there are ways to accurately decide scrollbar dragging.

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

4 participants