Skip to content
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

[MaterialTimePicker] Control Field Focus on Open #2862

Closed
jbh6gc opened this issue Jul 26, 2022 · 4 comments
Closed

[MaterialTimePicker] Control Field Focus on Open #2862

jbh6gc opened this issue Jul 26, 2022 · 4 comments

Comments

@jbh6gc
Copy link

jbh6gc commented Jul 26, 2022

Is your feature request related to a problem? Please describe.
My app opens the MaterialTimePicker dialog into text input mode. When this happens the hour field is focused. Since the hour field is focused the user can't see the current value of that field. It is a little confusing for the user not to have the context of what the current value is.

Describe the solution you'd like
The behavior of this scenario in the 1.6.1 version of the component is that the hour field is not focused when the dialog is first opened. This worked well for us. It looks like 72abed0 which was added in 1.7.0-alpha02 changed this behavior so that it focuses on open. It seems from #1511 that the intent was to focus the field when switching from clock mode to text mode so I was thinking it might make sense to only focus a field if it has been focused by the user already in any mode, but if opening directly in text input mode it would not focus anything right away.

Describe alternatives you've considered
I tried to just stick with version 1.6.1 for my app which has the desired behavior, but #2788 is big enough that we needed to upgrade to 1.7.0 to get the fix for it. I did not see any attributes or settings on the builder or picker itself that would flex this behavior for us either.

Additional context
Here's a screenshot of what the Time Picker looks like when we first open it in text input mode:
Screenshot_20220726-100208

@drchen
Copy link
Contributor

drchen commented Jul 26, 2022

Let's probably add and option to opt in/out this behavior?

@jbh6gc
Copy link
Author

jbh6gc commented Jul 26, 2022

Yeah, being able to opt in/out would definitely work for us. Thanks for the quick response!

@paulfthomas paulfthomas assigned drchen and unassigned paulfthomas Aug 1, 2022
@paulfthomas paulfthomas assigned paulfthomas and unassigned drchen Sep 1, 2022
@Shusek
Copy link

Shusek commented Oct 3, 2022

I get invalid reports from users that while they edit time the hour is always erasing (this is not true but for user it is not transparent). Will this optional flag be introduced or i should explain to users that this is normal behavior?

paulfthomas added a commit that referenced this issue Oct 5, 2022
@paulfthomas
Copy link
Member

Hi, we reviewed this issue with our designers and made a change, now the hour/minute edit texts are pre-filled and the text gets automatically replaced once the user starts typing (so no extra interaction required). See 56ea071.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants