Repository navigation
Focused search field hides prefix in higher accessibility text scale modes - #171406
Conversation
MitchellGoodwin
left a comment
There was a problem hiding this comment.
LGTM with one very minor nit
| if (widget.controller == null) { | ||
| _controller?.dispose(); | ||
| } | ||
| super.dispose(); |
There was a problem hiding this comment.
I took a look because I was curious, but it doesn't look like there wasn't a particular reason why super.dispose wasn't at the end before. #136615
There was a problem hiding this comment.
Yeah and @chunhtai mentioned how it's safest to have dispose in reverse order of initState.
| _controller!.dispose(); | ||
| _controller = null; | ||
| } | ||
| if (widget.focusNode == null && oldWidget.focusNode != null) { |
There was a problem hiding this comment.
Thing can be a lot easier if you do this
FocusNode get _effectiveFocusNode => widget.focusNode ?? (_focusNode ?? = FocusNode());
and don't need to recreate and proactively dispose in didUpdateWidget, just do a _focusNode?.dispose at the dispose.
There was a problem hiding this comment.
This although we may have a dangling internal focus node if widget rebuild with a non null widget.focusNode, but I think this is a rare case that people swap in and out of their focus node between each rebuild
There was a problem hiding this comment.
I missed this but it makes sense 👍
…modes (flutter#171406) ### Flutter https://github.com/user-attachments/assets/231a2e93-5fa8-4d67-933b-5d5585d05fb5 ### Native https://github.com/user-attachments/assets/94cbc0c1-1326-47db-a902-d91e8009318b Fixes [Focused CupertinoSearchTextField does not hide prefix in higher accessibility text scale modes](flutter#168255)
…modes (flutter#171406) ### Flutter https://github.com/user-attachments/assets/231a2e93-5fa8-4d67-933b-5d5585d05fb5 ### Native https://github.com/user-attachments/assets/94cbc0c1-1326-47db-a902-d91e8009318b Fixes [Focused CupertinoSearchTextField does not hide prefix in higher accessibility text scale modes](flutter#168255)
Flutter
flutter.hide.prefix.mov
Native
native.hide.prefix.mov
Fixes Focused CupertinoSearchTextField does not hide prefix in higher accessibility text scale modes