From the SmartGWT-Showcase/Forms/Text-Masking demo as a reference: If you paste (using CTRL+V) into any of the text fields, the masking mechanism yields a poor user experience. This is especially apparent for the “Phone No.” field as the masking template gets pushed beyond the end of the string that is pasted. While in some circumstances the field is left with valid data, in others it’s not. Overall, the user experience is such that uesrs end up basically typing what they intended to cut/copy/paste into the field.
Without having looked deeply into the underlying code that performs the text masking mechanism, is it something that can be easily fixed or worth of filing a bug?
The idea is to add a KeyUpHander on the field, then basically strip any mask info that the user thinks they need to paste into the field. Putting the raw value into the field makes the mask code happy again.
For instance, if the mask was (###) ###-#### a typical user would try to copy a number that looked like this. When the mask gets applied, the non-numeric values that were pasted in cause characters to get lost and the result would be absolutely wrong. But if the KeyUp handler then processes what they pasted and removes all but the numbers, then the mask knows what to do with it and all is well.