jQuery-Mask-Plugin icon indicating copy to clipboard operation
jQuery-Mask-Plugin copied to clipboard

using in contenteditable elements, odd behavior

Open rogerpec opened this issue 6 years ago • 4 comments

Hello.

Thank you Igor Escobar and contributors by this very usefull plugin.

I'm trying to use the plugin in some contenteditable elements such as divs and spans. But the behavior is being odd. When the typing reachs a symbol, the caret goes to start of element, even with no reverse option.

Here is a fiddle to check: https://jsfiddle.net/k6bc7v1z/9/

When typed 12-34 (typing the -), the result is 12-34, ok. When typed 1234, the result is 41-23

What I´m doing wrong? I read the issues and docs, but can't found solution.

Thanks in advance

rogerpec avatar Sep 12 '18 12:09 rogerpec

Facing the same behavior

With mask like $("[js-cta-phone]").mask("000 000-00-00");

when key pressed on the position of space or character "-" cursor jumps to the beginning (4th keyup). So 5th key will add user input at very beginning

dpmango avatar Nov 13 '18 15:11 dpmango

I am also having this problem and I find no solution. It's been 1 year since this post was made, did you guys achieve something satisfactory?

rocooliveira avatar Nov 09 '19 11:11 rocooliveira

No solution yet. The only option is not to use contenteditable (just regular input) for now

Also relevant issue #707

dpmango avatar Nov 10 '19 14:11 dpmango

Hey there! Planning on reopening issues? Ready to test if it still occurring unexpected behavior...

dpmango avatar Oct 18 '21 18:10 dpmango