microsoft / fluentui

Fluent UI web represents a collection of utilities, React components, and web components for building web applications.
https://react.fluentui.dev
Other
18.46k stars 2.72k forks source link

[Bug]: Popover, Dropdown and Combobox do not close on parent scroll or resize #31541

Open SharonCKC opened 4 months ago

SharonCKC commented 4 months ago

Library

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

System Info

System:
    OS: macOS 14.5
    CPU: (10) arm64 Apple M1 Pro
    Memory: 470.73 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Browsers:
    Chrome: 125.0.6422.113
    Safari: 17.5

Are you reporting Accessibility issue?

None

Reproduction

https://codesandbox.io/p/sandbox/old-dawn-vt3wjt?file=%2Fexample.tsx

Bug Description

Actual Behavior

When dragging the scrollbar, or dragging the resize handle, of an element containing a dropdown, combobox, or popover, the listbox/PopoverSurface doesn't close, causing the listbox or PopoverSurface to appear outside of the container.

image

Expected Behavior

It should close as soon as the user clicks or drags anywhere outside of the component.

Logs

No response

Requested priority

High

Products/sites affected

No response

Are you willing to submit a PR to fix?

no

Validations

JoseHerminioCollas commented 4 months ago

On clicking outside of the Combox area, trigger.onBlur is called. The following webtools snapshot shows onBlur being called on a click outside of the Combox.

Screenshot (1)

On resize and scroll, trigger.onBlur is not called, and the appropriate methods to close the ListBox are not called.

miroslavstastny commented 2 months ago

This is a new feature request, the library should support that.

SharonCKC commented 2 months ago

Thank you for looking into it. From our perspective it is a bug rather than a new feature, because we migrated from Fluent 1 which did not have the issues we are observing with Fluent 2.