Open juuso-vaadin opened 3 months ago
Here's a sample for small wiggle animation that could indicate that field cannot accept input. This can be due to max limit reached or trying to enter a character that is not allowed. https://codepen.io/juuso-vaadin/pen/QWXLErW
After investigation, the javascript library cleave.js
doesn't give any hook or any solution to see if the value has been stripped or not.
That would require to change the javascript and that doesn't seem to be easy to do.
Example 1
Field with formatting
NumeralFieldFormatter(",", ".", 2)
will formatExample 2
Field with formatting
CustomStringBlockFormatter.Builder().blocks(3, 3, 3).delimiters("-")
will formatExample 3
Field with formatting
IBANFormatter.fromIBANLength(18)
will formatImprovement idea
As generic solution, component should recognize if inputted characters are cut out. This is mainly an issue when pasting in values. Component could also indicate if user is trying to type in a field that has already reached the max number of characters.