I have a CustomScrollView
with a SliverAppBar
that hides on scroll.
On the app bar is a search button that, when pressed, puts a TextField
into the app bar.
When the field gets focus, it causes the scroll view to scroll all the way to the top, and the app bar gets stuck up in the "unsafe" area:
The Scaffold docs mention that when the keyboard is shown the scaffold's insets change and the scaffold is rebuilt, causing the "focused widget will be scrolled into view if it's within a scrollable container".
This seems like the behavior I don't want. I looked but couldn't understand the mechanism or how to suppress it. Is doing so possible?
The source code for the view in the image is here.
Also I note that this problem didn't happen in my previous implementation with non-sliver, standard widgets. I suspect this is because the app bar was not in a scrollable view, whereas SliverAppBar
is inside the CustomScrollView
so that it can interact with the main body.