Mottie / Keyboard

Virtual Keyboard using jQuery ~
http://mottie.github.io/Keyboard/
Other
1.78k stars 723 forks source link

Firefox didn't type spaces to contenteditable div. #658

Open smart616 opened 6 years ago

smart616 commented 6 years ago

When I type to div with contenteditable = true some text, some spaces are removed. Space is removed when you type space and wait about 1 second and then you type another character. When you type space and immediately type another character space stay at div. You can see this bug also in your demo page. Tested in Firefox 58.0.2 windows 10. Chrome, Opera and Edge are fine, no errors.

Mottie commented 6 years ago

Hi @smart616!

I was not able to reproduce this issue in Firefox 58.0.2 and Windows 10.

Would you please desribe how to reproduce this issue in a step-by-step manner, or provide a screen capture.

smart616 commented 6 years ago

The caret must be at the end of text.

ezgif com-crop

Mottie commented 6 years ago

Thanks for the clarification! I'll look into it.

Mottie commented 6 years ago

Sorry, this'll take me a little longer to fix. Firefox behaves differently than other browsers – see https://jsfiddle.net/Mottie/okza6kpL/ – when you insert a space at the end.

rhettplace commented 5 years ago

Hi Mottie,

Any update on this issue? I've run into the exact same problem and I see that the last update was posted over a year ago. Just wondering if there is a fix in the works or if I should move on to something else.

I'm thinking of trying to always have a space at the end of the div text so that the user is essentially always writing inside the div contents, rather than at the end which seems to be where the bug lies. If there are any other work-arounds, I'd appreciate any tips.

Thanks!

Mottie commented 5 years ago

Sorry I haven't had much time lately to work on this issue. I think adding a space might work, but may not if the user presses the End key. I was kinda hoping Firefox would fix this issue LOL.

rhettplace commented 5 years ago

No problem. Totally understand. If I get something working, I will post the fix. For now, I'm just going to require Chrome (very small user set).

Thanks!