Skip to content

Breaking Change Missing maintainFocusability v3.35 #174652

@AFAS-HHO

Description

@AFAS-HHO

Request to add a list item on the breaking changes for Flutter V3.35 as listed here

The following item from the Flutter Changelog seems to have caused a breaking change:
Add flag to exclude focus for hidden children in Visibility, maintainFocusability. Set maintainFocusability to false in IndexedStack by @skimm3 in 159133

To get the same working as in previous Flutter versions you now have to manually set maintainFocusability to true. In this case the default value results in different behaviour from the previous version.

For example when using an invisible text field to allow for input being rendered in a way which TextField doesn't allow for you'd use something alike (with a way to set focus on the field):

            Visibility(
              visible: false,
              maintainState: true,
              child:TextField(/****/),
              ),

This used to work but now one has to add maintainFocusability: true, to get the same result.

It would be useful to have a mention on the breaking changes which says something alike: Visibility Widgets relying on being able to focus a child element of said widget now require the new parameter maintainFocusability: true, to be set.

Metadata

Metadata

Labels

d: api docsIssues with https://api.flutter.dev/found in release: 3.35Found to occur in 3.35found in release: 3.36Found to occur in 3.36frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer versionteam-frameworkOwned by Framework team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions