ui-mask
ui-mask copied to clipboard
Russian characters in placeholder IE issue
Hi everyone. I have a problem with placeholder in IE 10/11. When placeholder consists from only english letters i see correct placeholder value. But when i add any russian character in placeholder, the placeholder is replaced with empty mask value.
Plunkr here (open in IE 10/11)
Also, when i focus and blur element, placeholder appears.
I've found that IE broadcasts "input" event on start. Adding of this in the end of eventHandler
solves the problem.
if (eventType == 'input'){ blurHandler(); }
But i don't think that it is good solution.
Adding that blurHandler call on input would probably cause some weird behavior. I'll debug it and see if I can find out what is happening.
Not sure why but the reason you don't see the placeholder (when it has Russian characters) is because the value of the element is set as if the element has focus. However, this only happens with placeholders that have Russian characters (I haven't verified but I would guess any placeholder with non-Ascii characters would have this issue).
This might just be an issue with IE.
I had the same issue with Polish characters in placeholder.
I investigated the problem and the input event which is fired by IE has its own data property undefined so it’s easy to detect it.
I think that adding:
(eventType === 'input' && !e.data)
to this condition (as another alternative):
// These events don't require any action
if (isSelection ||
(isSelected &&
(eventType === 'click' || eventType === 'keyup' || eventType === 'focus'))) {
return;
}
would be necessary but in my case I don’t want to fork this project (it seems to be no longer maintained, though).