Doesn't work on chrome for android in Kitkat #81

Open
marksalpeter opened this Issue May 14, 2015 · 4 comments

Projects

None yet

5 participants

No description provided.

damirsel commented Jun 9, 2016 edited

Mobile Chrome browser and other browsers based on mobile Chrome don't recognize keypress event, so you need to put new 'input' event listener that will listen to keys pressed

inside function Formatter(el, opts) put following code:

utils.addListener(self.el, 'input', function (evt) { self._keyPress(evt); if (self.el != null) { if (self.el.createTextRange) { var range = self.el.createTextRange(); range.move('character', self.el.value.length); range.select(); } else { if(self.el.selectionStart) { self.el.focus(); self.el.setSelectionRange(self.el.value.length, self.el.value.length); } else { self.el.focus(); } } } });

@damirsel doesn't work for me. With this code I'm unable to type on mobile completely.

Fix doesn't work for me either.

edtsz commented Mar 24, 2017

@damirsel thanks .. it works very well for me.. (with some improvements, because the var names are different)

@edtsz edtsz added a commit to edtsz/formatter.js that referenced this issue Mar 24, 2017
@edtsz edtsz Fix `keypress` for mobile Chrome based browsers
As described by @damirsel on issue #81
c830f60
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment