wymeditor does not accept the AltGr + i character

47 views Asked by At

We've just had a problem come up when users try and enter the character í or Í (AltGr + i/I). In wymeditor it just doesn't appear, though as you can see here it is accepted by input fields on other websites when using the same browser.

I have tested it on the basic wymeditor examples and they also fail to display anything for AltGr + i. The issue can be recreated on other machines and various browsers.

Other characters like ú, ó, á and ú work fine (looks like I'm missing a vowel somewhere...) and it is possible to cut and paste the í or Í characters from another application in to wymeditor. My best guess at this point is that wymeditor is intercepting the keypress for some reason.

Any suggestions would be greatly appreciated - translators really struggle with this sort of thing!

1

There are 1 answers

2
Jason On BEST ANSWER

I believe I have discovered the issue in the wymeditor source. This code is being used to apply bold and italic formatting to the text:

WYMeditor.WymClassSafari.prototype.keydown = function (e) {
    //'this' is the doc
    var wym = WYMeditor.INSTANCES[this.title];

    if (e.ctrlKey) {
       ...

It will not only pick up Ctrl, but according to most modern browsers AltGr as well since this is reported as Ctrl and Alt being held together. I must admit I didn't see that it was picking up the AltGr key simply because my own wymeditor extension prevents the styles being applied, but in any case it will make it impossible for a user to create the í character in the editor.

See this answer for the current browser behaviour of AltGr.