Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@mdebbar
Copy link
Contributor

@mdebbar mdebbar commented Sep 12, 2024

In certain situations, semantics elements get assigned pointer-events: none when they aren't supposed to.

One such situation is when a text field has a decoration error text. The semantics node become a container, and we always set pointer-events: none on container nodes.

This PR introduces an acceptsPointerEvents getter on SemanticRole and SemanticBehavior to control when pointer-events should be all or none.

Fixes flutter/flutter#141975

@mdebbar mdebbar requested a review from yjbanov September 12, 2024 17:50
@github-actions github-actions bot added the platform-web Code specifically for the web engine label Sep 12, 2024
// This is so that the platform views are not obscured by semantic elements
// and can be reached by inspecting the web page.
if (!hasChildren && !isPlatformView) {
if (semanticRole!.acceptsPointerEvents) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm wondering if we should also check _rect.isEmpty. Although, I can't imagine the framework merging a tappable node such that the merged result is empty. So maybe I'm overthinking this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're worried that we may set pointer-events: all on an empty rect? I don't know if this case ever happens or not, but even if it does, I don't see a problem with accepting pointer events on an empty rect that's not going to obscure anything 🙂

Copy link
Contributor

Choose a reason for hiding this comment

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

Fair point!

@mdebbar mdebbar marked this pull request as ready for review September 17, 2024 18:06
Copy link
Contributor

@yjbanov yjbanov left a comment

Choose a reason for hiding this comment

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

lgtm

@mdebbar mdebbar added the autosubmit Merge PR when tree becomes green via auto submit App label Sep 24, 2024
@auto-submit auto-submit bot merged commit 35af5fe into flutter:main Sep 24, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Sep 24, 2024
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Sep 24, 2024
thejitenpatel pushed a commit to thejitenpatel/flutter that referenced this pull request Sep 26, 2024
thejitenpatel pushed a commit to thejitenpatel/flutter that referenced this pull request Sep 26, 2024
thejitenpatel pushed a commit to thejitenpatel/flutter that referenced this pull request Sep 27, 2024
thejitenpatel pushed a commit to thejitenpatel/flutter that referenced this pull request Sep 27, 2024
@mdebbar mdebbar deleted the ios_input_decoration_fix branch October 1, 2024 17:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

autosubmit Merge PR when tree becomes green via auto submit App platform-web Code specifically for the web engine

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Web] - Broken TextField in Semantics mode when given an InputDecorator with errorText on mobile browsers

2 participants