Skip to content

Commit 3f1f0aa

Browse files
authored
Enable TapRegion to detect all mouse button click (#136799)
With this PR, TapRegion would be able to detect any kind of mouse button events. Earlier, TapRegion used to detect only left mouse button event. Fixes #136706 ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [ ] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/wiki/Tree-hygiene#overview [Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene [test-exempt]: https://github.com/flutter/flutter/wiki/Tree-hygiene#tests [Flutter Style Guide]: https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo [Features we expect every widget to implement]: https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/wiki/Chat
1 parent 0f67c99 commit 3f1f0aa

2 files changed

Lines changed: 575 additions & 1 deletion

File tree

‎packages/flutter/lib/src/widgets/tap_region.dart‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ class RenderTapRegionSurface extends RenderProxyBoxWithHitTestBehavior implement
234234
return true;
235235
}(), 'A RenderTapRegion was registered when it was disabled.');
236236

237-
if (event is! PointerDownEvent || event.buttons != kPrimaryButton) {
237+
if (event is! PointerDownEvent) {
238238
return;
239239
}
240240

0 commit comments

Comments
 (0)