parttio / textfieldformatter

TextField Formatter Vaadin add-on
Apache License 2.0
13 stars 9 forks source link

Issues when removing IBAN Formatter #32

Closed Charlie28000 closed 3 years ago

Charlie28000 commented 3 years ago

It seems that previously set IBANFormatters aren't removed properly:

TextField text = new TextField();

IBANFormatter formatter = IBANFormatter.fromIBANLength(22);
formatter.extend(text);
formatter.remove();

formatter = IBANFormatter.fromIBANLength(19);
formatter.extend(text);
formatter.remove();

formatter = IBANFormatter.fromIBANLength(22);
formatter.extend(text);

Outcome is a Textfield with IBAN limited to 19 characters, my expectation would be 22.

TextField text = new TextField();

IBANFormatter formatter = IBANFormatter.fromIBANLength(19);
formatter = IBANFormatter.fromIBANLength(22);
formatter.extend(text);
formatter.remove();

Outcome is a Textfield with IBAN of length 22, my expectation would be a field without formatting.

johannesh2 commented 3 years ago

Thanks for the report. I'll check if it's an easy fix. I'm unfortunately a bit busy now.