fix(react-utilities): useOnClickOutside check if mouseDown happens inside regardless of disable option#29061
Closed
YuanboXue-Amber wants to merge 5 commits into
Closed
Conversation
disable option
disable optionuseOnClickOutside check if mouseDown happens inside regardless of disable option
Collaborator
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:
|
Collaborator
📊 Bundle size reportUnchanged fixtures
|
Asset size changesSize Auditor did not detect a change in bundle size for any component! Baseline commit: 0bf811dbcaaa6b78743537d142fe4d348b457045 (build) |
Collaborator
🕵 fluentuiv9 No visual regressions between this PR and main |
Contributor
Author
|
/azp run |
|
Azure Pipelines successfully started running 4 pipeline(s). |
YuanboXue-Amber
force-pushed
the
fix-context-menu
branch
from
September 5, 2023 10:14
6f2ddd9 to
ce5953a
Compare
Contributor
Author
|
Close as we decide to revert the original PR that causes the issue: #29065 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

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.
useOnClickOutsidehas 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.