Skip to content

ModalBarrier and Drawer barrier prevents mouse events#44296

Merged
dkwingsmt merged 6 commits intoflutter:masterfrom
dkwingsmt:router-mouse-opaque
Nov 13, 2019
Merged

ModalBarrier and Drawer barrier prevents mouse events#44296
dkwingsmt merged 6 commits intoflutter:masterfrom
dkwingsmt:router-mouse-opaque

Conversation

@dkwingsmt
Copy link
Contributor

@dkwingsmt dkwingsmt commented Nov 6, 2019

Description

This PR adds a full-container opaque MouseRegion to the following widgets in order to prevent widgets behind it reacting to mouse events:

  • ModalBarrier
  • The barrier of Drawer

Check out related issues to see reason of this change.

How do I make sure they are all cases that need changing? I searched BlockSemantics and they are the only usages.

Related Issues

Tests

I added the following tests:

  • Drawer hover test
  • ModalBarrier prevents hover interactions with widgets behind it
  • ModalBarrier does not prevent hover interactions with widgets in front of it
  • an empty opaque MouseRegion is effective

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I signed the CLA.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I updated/added relevant documentation (doc comments with ///).
  • All existing and new tests are passing.
  • The analyzer (flutter analyze --flutter-repo) does not report any problems on my PR.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Does your PR require Flutter developers to manually update their apps to accommodate your change?

  • Yes, this is a breaking change (Please read Handling breaking changes). Replace this with a link to the e-mail where you asked for input on this proposed change.
  • No, this is not a breaking change.

@fluttergithubbot fluttergithubbot added f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. labels Nov 6, 2019
@dkwingsmt dkwingsmt added f: gestures flutter/packages/flutter/gestures repository. a: desktop Running on desktop labels Nov 6, 2019
@shyndman
Copy link
Contributor

Nice!

Have you considered adding this to IgnorePointer as well? (#35213)

@dkwingsmt
Copy link
Contributor Author

@shyndman That needs a different approach. I'll do it in another PR. Thanks for reminding though.

@shyndman
Copy link
Contributor

You're welcome. Happy to see these updates land. :)

@gspencergoog gspencergoog self-requested a review November 12, 2019 22:11
Copy link
Contributor

@gspencergoog gspencergoog left a comment

Choose a reason for hiding this comment

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

32384589-a60f0e74-c078-11e7-9bc1-e5b5287aea9d

@dkwingsmt dkwingsmt merged commit 01f4f1a into flutter:master Nov 13, 2019
@dkwingsmt dkwingsmt deleted the router-mouse-opaque branch November 13, 2019 18:22
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

a: desktop Running on desktop f: gestures flutter/packages/flutter/gestures repository. f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Route should be opaque to MouseEnter/Exit events Hover effects are incorrectly shown for all widgets under cursor.

5 participants