Discover Quicktype iOS 8 Tooltip Palette

For editing extended text, I have a UIWebView where I load local html content with some contenteditable div. When the user presses some keys on the keyboard, I want to detect changes in the content inside this div, resize it accordingly and scroll to position the cursor over the keyboard.

I can do this with the onkeyup event onkeyup :

<div id="contents" onkeyup="keyup()" onpaste="paste()" contenteditable="true">...</div>

The iOS 8 keyboard now has a Quicktype panel with some tips for quickly pasting into an editable area. How to determine the effect of inserting sentence text in a div?

An event handler such as onkeyup does not help when inserting text without pressing the keyboard keys; the onpaste event onpaste not raised. I also tried to implement MutationObserver to detect DOM changes when something is inserted - also does not help.

I am struggling to find a working solution. Any advice is appreciated. Thanks!

+5
source share
1 answer

In Mobile Safari, iOS 8 Quicktype words fire two (possibly identical?) input events.

Try this in the developer console:

 $('input[type=text]').on("input", console.log.bind(console, "input!")); 

In UIWebView I have not tried ...

+2
source

Source: https://habr.com/ru/post/1205135/


All Articles