formatter.js icon indicating copy to clipboard operation
formatter.js copied to clipboard

Doesn't work on chrome for android in Kitkat

Open marksalpeter opened this issue 10 years ago • 4 comments

marksalpeter avatar May 14 '15 01:05 marksalpeter

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 avatar Jun 09 '16 19:06 damirsel

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

GendelfLugansk avatar Aug 29 '16 11:08 GendelfLugansk

Fix doesn't work for me either.

CraigChaffee avatar Nov 04 '16 00:11 CraigChaffee

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

edtsz avatar Mar 24 '17 12:03 edtsz