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

Stop typing from keyboard #27

Open
vishaldroisys opened this issue Jan 9, 2023 · 1 comment
Open

Stop typing from keyboard #27

vishaldroisys opened this issue Jan 9, 2023 · 1 comment
Labels
question Further information is requested

Comments

@vishaldroisys
Copy link

Hello,

How to stop typing from keyboard?

We have limit to stop typing from particular limit like 1500 character.

Thanks in advance.

@niw niw added the question Further information is requested label Jan 11, 2023
@niw
Copy link
Contributor

niw commented Jan 11, 2023

This is techinically possible, yet not recommend in terms of UI/UX standing point.

Preventing typing causes many issues for those who're using Input Method (a program that is used for typing non-English characters,) such as typing Japanese, Chinese, or other consideration is those who're using accessibility features.

The recommended implementation for such use case e.g. limiting the length of user's input is not limiting keyboard typing instead, limiting "commit" the typed text. For example, if the text is in a kind of form view, change the "Done" or "Submit" button isEnabled of the borm to not let users to commit the text if it's exceeding the limit of length.
It would be also better to communicate users why they can't commit the text e.g. changing text color where the exceeded characters. You can implement such behavior by using TextEditorViewTextAttributesDelegate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants