I’m having the same issue of Jeyhun Mamedov. I’m using Vaadin with Spring boot (Vaadin version 14.2.3 and Spring Boot 2.3.1) and none of the formatter seems work. I tried remove and reinstall node_modules, and I see that cleave.js and its dependencies is there and nothing.
My sample code:
public static TextField createCnpjField(String label) {
final TextField field = new TextField(label);
new CustomStringBlockFormatter.Builder()
.blocks(2, 3, 3, 4, 2)
.delimiters(".", ".", "/", "-")
.numeric()
.build().extend(field);
return field;
}
What could be wrong?
I’ll appreciate if you could help me. Thanks.
I’m sorry, it seems that some change between Vaadin 14.2.1 and 14.2.2 has broken the add-on. I need to investigate whether it’s a bug in Vaadin or something I need to fix.
5.2.0.pre should fix the user input formatting. I still need to figure out if I can get setValue to format the input, because I needed to remove the previous hacky fix for it.