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

[MaterialDatePicker] Disabling input mods switch change and setting input text #3624

Open
SmirnovDV-98 opened this issue Oct 10, 2023 · 2 comments

Comments

@SmirnovDV-98
Copy link

1st point - I've been looking for options to switch off text input mode, block input variants changing or just remove the inputmode toggle(attached image1). I've saw a previous discussions about such issue, such as #1380 , but none of the suggested methods works now. Setting attributes visibility/clickable through styles causes error:
causes exception, that reffers to 31st line of mtrl_picker_dialog and method builder.setToggleInputModeEnable(false) doesn't exist anymore.

2nd point - is there any kind of way to set text watcher for text input field, or any other way that allow to apply mask like "##.##.####" to inputting symbol. Such as auto-adding . to number input like 21.02.1993, and not allow to input any further. Simple date formats, that could be set with setTextInputFormat() doesn't provide such functionality, not preventing further year input for formats like "dd.MM.yyyy"

Attached image1
screen_1

@hunterstich
Copy link
Contributor

Hi @SmirnovDV-98,

1 - We don't have any plans to make it easier to disable the text input switch as this is the primary means of making the component accessible for some users

2 - To clarify, you'd like to be able to set a text watcher on the input field to run any transformations when the text changes? Like stopping additional input after the full date has been input?

@SmirnovDV-98
Copy link
Author

About second part. Yes, I'd like to have a ability to control behavior of the text input, such as stopping additional input, or adding any kind of custom validation checks after last symbol was entered.

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

2 participants