-
-
Couldn't load subscription status.
- Fork 1k
Fix MaskedInput selection replace with invalid value #5494
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
Fix MaskedInput selection replace with invalid value #5494
Conversation
|
The Wouldn't this PR only replace a single character, rather than the whole selection as you would expect? |
|
You are right |
Fixed |
|
Unfortunately, I think fixing the For example, try running the credit card example in the docs with the changes in this PR. After entering some numbers to complete the input, try selecting some text using the mouse (it might help adding the highlighting) then enter a number. This will crash if the selection included a separator as the value does not match the template. |
|
This is now fixed.
|
|
Hi @JonathanPlasse Thanks for this. Could we please have a test? |
|
I am sorry, I do not have the bandwidth to add tests at the moment. |
Please review the following checklist.
This PR implements the
MaskedInput.replace()method by using the already existingMaskedInput.insert_text_at_cursor()which replace the characters following the cursor position.