这是indexloc提供的服务,不要输入任何密码
Skip to content

Don't allow Disabled InkWells to be focusable #43848

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

Merged
merged 4 commits into from
Oct 31, 2019

Conversation

gspencergoog
Copy link
Contributor

Description

Makes sure that disabled InkWell/InkResponse and widgets that use them don't allow themselves
to be focused.

ListTile, PopupMenu, and Stepper were not setting canRequestFocus properly on the InkWell, and InkWell was allowing focus even if it was disabled (it was basically just relying on the containing widget to set canRequestFocus properly). Now InkWell must both be enabled (have an onTap or similar) and have canRequestFocus set to true.

Related Issues

Tests

  • Added tests for InkWell, ListTile, PopupMenu, and Stepper.

Breaking 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 Oct 30, 2019
@gspencergoog gspencergoog changed the title Disabled inkwell Don't allow Disabled InkWells to be focusable Oct 30, 2019
Copy link
Contributor

@shihaohong shihaohong left a comment

Choose a reason for hiding this comment

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

LGTM

@gspencergoog gspencergoog merged commit 0028887 into flutter:master Oct 31, 2019
@gspencergoog gspencergoog deleted the disabled_inkwell branch November 13, 2019 23:13
Inconnu08 pushed a commit to Inconnu08/flutter that referenced this pull request Nov 26, 2019
Makes sure that disabled InkWell/InkResponse and widgets that use them don't allow themselves to be focused.

ListTile, PopupMenu, and Stepper were not setting canRequestFocus properly on the InkWell, and InkWell was allowing focus even if it was disabled (it was basically just relying on the containing widget to set canRequestFocus properly). Now InkWell must both be enabled (have an onTap or similar) and have canRequestFocus set to true.
@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
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.

4 participants