-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Bug with text limit constraint as a plugin. #4795
Comments
I looked at both the issues(you mentioned) but could not come up with a solution (rather do not understand what to do.) In the meantime, I noticed that if you keep typing past the threshold and hit enter it not only takes you to the new line but also remove all the additional characters that were above the specified limit and if you then try to enter characters on the new line it prevents you from entering. |
I encountered the same problem, and did some step-debugging.
native = true flow, but when a number is inserted, the native is false .
This stems from the regex on this line
Hopefully someone with more insight in the code knows how to fix this. |
Description
The given code doesn't work with you inputting alphabets but works when inputting numbers.
I tried using the old version of slate and slate-react (both at version 0.63) and it worked.
Sandbox
Here is a link to codesandbox with the issue.
Steps
To reproduce the behavior:
Expectation
You should not be able to insert any characters after the specified limit whether number or alphabet.
Actual Result
When you type numbers the given code will work as expected. But when you use alphabets the given code fails to prevent insertion after the specified limit. When you try hitting backspace the text is also not deleted until you are not below the threshold specified.
Environment
The text was updated successfully, but these errors were encountered: