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

Restore button filter for dialog closing #1336

Merged
merged 2 commits into from May 2, 2024

Conversation

MatkovIvan
Copy link
Member

Fine tune #1280 change. The problem is some components like bottom sheet or navigation drawer define custom scrim and detect click on them via regular detection like detectTapGestures (that filters only primary mouse button). So to keep things consistent, we need to revert primary button filtering for Dialog, but keep it as-is for Popup to avoid breaking dropdowns,

Testing

Unit test: DialogTest
Try to close Popup and Dialog by outside click via mouse buttons and touch.
This should be tested by QA

Release Notes

Fixes - Desktop

  • (prerelease fix) Fix inconsistency in closing Dialog by mouse clicking on scrim that was introduced by 1.6.10-beta02

@MatkovIvan MatkovIvan requested review from m-sasha and igordmn May 2, 2024 08:38
Comment on lines +77 to +80
private var outsidePointerCallback: ((
eventType: PointerEventType,
button: PointerButton?
) -> Unit)? = null
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe worthwhile to typealias it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or some event type with reduced scope as parameter. But the problem here - it should be public

@MatkovIvan MatkovIvan merged commit 9fa1fbb into jb-main May 2, 2024
5 of 6 checks passed
@MatkovIvan MatkovIvan deleted the ivan.matkov/fix-outside-click-filter branch May 2, 2024 14:19
igordmn pushed a commit that referenced this pull request May 2, 2024
Fine tune #1280 change. The problem is some components like bottom sheet
or navigation drawer define custom scrim and detect click on them via
regular detection like `detectTapGestures` (that filters only primary
mouse button). So to keep things consistent, we need to revert primary
button filtering for `Dialog`, but keep it as-is for `Popup` to avoid
breaking dropdowns,

## Testing

Unit test: `DialogTest`
Try to close `Popup` and `Dialog` by outside click via mouse buttons and
touch.
This should be tested by QA

## Release Notes

### Fixes - Desktop
- _(prerelease fix)_ Fix inconsistency in closing `Dialog` by mouse
clicking on scrim that was introduced by `1.6.10-beta02`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants