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

[MaterialComponentsAndroid-MaterialDatePicker] Incorrect behaviour on Samsung device #3625

Closed
SmirnovDV-98 opened this issue Oct 10, 2023 · 12 comments

Comments

@SmirnovDV-98
Copy link

On Samsung Galaxy S9 Api30 date picker component from demo application behaves totally incorrectly.

System information:

system1
System2

Text input works completely incorrectly, not applying text format and treating hint as simple text

Video of incorrect work attached:
https://github.com/material-components/material-components-android/assets/61781754/e6a7b812-2565-440b-80e5-c6c93a270054

@hunterstich
Copy link
Contributor

Hi @SmirnovDV-98,

Could you describe what the expected behavior should be? I see the same behavior on my end running Android 14 on a Pixel but I think this is working as intended.

@SmirnovDV-98
Copy link
Author

SmirnovDV-98 commented Oct 11, 2023 via email

@SmirnovDV-98
Copy link
Author

video of expected behaviour

video_2023-10-11_08-17-29.mp4

video of expected behaviour

@hunterstich
Copy link
Contributor

Ah, so the issue is the IME (keyboard) that shows on Samsung is the full alphanumeric keyboard instead of just the numeric keyboard?

@pubiqq
Copy link
Contributor

pubiqq commented Oct 12, 2023

Ah, so the issue is the IME (keyboard) that shows on Samsung is the full alphanumeric keyboard instead of just the numeric keyboard?

No, the issue is that the date field is automatically filled with the hint text when you enter a character:

Actual result Expected result
video_2023-10-10_17-30-10.mp4
video_2023-10-11_08-17-29.mp4

@hunterstich
Copy link
Contributor

Ah! Thanks for the clarification. And thanks for the PR @pubiqq.

#3628

@paulfthomas paulfthomas self-assigned this Oct 26, 2023
@pubiqq
Copy link
Contributor

pubiqq commented Oct 26, 2023

Unfortunately, 5aa6edf is an unreliable hack, not a fix. It would be great if you would replace it with this this proposal.

@paulfthomas
Copy link
Member

@pubiqq I don't think your fix properly accounts for all the different languages/international date patterns.

@pubiqq
Copy link
Contributor

pubiqq commented Oct 30, 2023

I don't think your fix properly accounts for all the different languages/international date patterns.

The current implementation doesn't do that either 😂.

My implementation is much better because it uses the actual date pattern and filters characters that are guaranteed to be delimiters, whereas the current implementation uses a decorative string (huh?) and filters all letters and digits in it (huh? x2).

As a result, my implementation works just as well as the current one, but it also:

  • Works correctly with digits in the pattern.
  • Works correctly with non-Latin letters in the pattern.
  • Works correctly with Korean and some other languages (actually, I could even get rid of the hack related to the Korean language in this PR, but I'd like to do it a bit later in another one).

To account for all the different languages/international date patterns, we will also need to implement the correct handling of single quotation marks, but personally I will be ready to do this only after the DateFormatTextWatcher is fixed.

@automaton82
Copy link

This is affecting me as well with a S22+, it's impossible to type the date anymore. The cursor constantly goes to the end of the input after every key press.

Rolling back to com.google.android.material:material:1.9.0 solves the problem, it appears to be a regression in 1.10.0. It would be great if #3662 fixes it, but until then the latest version is unusable.

@GaelCO
Copy link

GaelCO commented Dec 19, 2023

Hi,
This issue is still present in version 1.11.0 on Samsung Galaxy Tab active and Samsung Gataxy Tab Active 3.
No bug on emulator.
As @automaton82 , I roll back to 1.9.0 to solve the problem

@nowulus
Copy link

nowulus commented Jul 11, 2024

material version 1.12.0 fixes the problem

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