Open cedvdb opened 3 years ago
@cedvdb
Since you've set autofocus: true
, the textfield will always have the cursor focus. If you apply a height to the bottomsheet container (ex: height: 200
) and then tap on show bottom sheet
, you'll notice that the cursor focus is in the textfield still and hence the bottomsheet's textfield didn't receive the focus.
modalBottomSheet
is not same as bottomsheet and may not reflect same behavior. According to the docs,
Modal. A modal bottom sheet is an alternative to a menu or a dialog and prevents the user from interacting with the rest of the app. Modal bottom sheets can be created and displayed with the showModalBottomSheet function.
Hence, the behavior is different as compared to bottomsheet
.
the autofocus is also set in my bottom sheet. Since it is in front it is expected to be focussed.
The fact that it takes the whole page was to accentuate that fact, but even if it was of size 200 and had autofocus true
it would be expected to take focus.
Imo, from an UX perspective, if it appears above the content and has autofocus, it should take focus. I can't imagine a scenario where that wouldn't be the case.
Thanks for the details. Keeping this open for further insights from team.
Cc: @Piinks
When a textfield with autofocus is used in a bottomSheet, the autofocus is not granted to the input and stays on the page in the back. It works for a modalBottomSheet though.
Reproduction: