ui-mask icon indicating copy to clipboard operation
ui-mask copied to clipboard

Russian characters in placeholder IE issue

Open retroq opened this issue 9 years ago • 4 comments

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)

retroq avatar May 18 '16 15:05 retroq

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.

retroq avatar May 18 '16 15:05 retroq

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.

lukepfeiffer10 avatar May 20 '16 13:05 lukepfeiffer10

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.

lukepfeiffer10 avatar Jun 10 '16 13:06 lukepfeiffer10

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).

didnotwant avatar Feb 26 '18 16:02 didnotwant