-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
fix(react-utilities): useOnClickOutside
check if mouseDown happens inside regardless of disable
option
#29061
fix(react-utilities): useOnClickOutside
check if mouseDown happens inside regardless of disable
option
#29061
Conversation
disable
option
disable
optionuseOnClickOutside
check if mouseDown happens inside regardless of disable
option
Perf Analysis (
|
Scenario | Render type | Master Ticks | PR Ticks | Iterations | Status |
---|---|---|---|---|---|
InfoButton | mount | 11 | 14 | 5000 | Possible regression |
All results
Scenario | Render type | Master Ticks | PR Ticks | Iterations | Status |
---|---|---|---|---|---|
Avatar | mount | 624 | 621 | 5000 | |
Button | mount | 318 | 305 | 5000 | |
Field | mount | 1091 | 1099 | 5000 | |
FluentProvider | mount | 705 | 682 | 5000 | |
FluentProviderWithTheme | mount | 77 | 70 | 10 | |
FluentProviderWithTheme | virtual-rerender | 62 | 67 | 10 | |
FluentProviderWithTheme | virtual-rerender-with-unmount | 80 | 76 | 10 | |
InfoButton | mount | 11 | 14 | 5000 | Possible regression |
MakeStyles | mount | 865 | 851 | 50000 | |
Persona | mount | 1709 | 1681 | 5000 | |
SpinButton | mount | 1340 | 1364 | 5000 |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit ce5953a:
|
📊 Bundle size reportUnchanged fixtures
|
Asset size changesSize Auditor did not detect a change in bundle size for any component! Baseline commit: 0bf811dbcaaa6b78743537d142fe4d348b457045 (build) |
🕵 fluentuiv9 No visual regressions between this PR and main |
/azp run |
Azure Pipelines successfully started running 4 pipeline(s). |
6f2ddd9
to
ce5953a
Compare
Close as we decide to revert the original PR that causes the issue: #29065 |
Previous Behavior
For popover with
openOnContext
, right click on the trigger, notice the popover is opened. Keep the mouse pressed, move the mouse outside of trigger and popoverSurface and then mouseUp, notice the popover is closedNew Behavior
Popover should not close in the above case.
Fix
The previous behavior happens because PR #28965 closes popover on mouseUp.
useOnClickOutside
has a mouseDown handler to check the mouseDown happens inside trigger/popover after popover opens. On context menu click, events are mouseDown -> contextMenu -> mouseUp (unlike left click where click fires after mouseUp). Therefore when contextMenu event opens popover, it is too late to check if mouseDown happens inside trigger.This PR makes the change to listen to mouseDown on trigger/popover regardless of popover open state.