Typing with an IME (for CJK characters), it needs user key in few keystrokes to compose a character.
The Autocomplete in D8 attached INPUT event to listen to every keystroke you typed and send keystrokes to the remote server to receive prediction.
For example, to compose the Traditional Chinese character "LIKE", you will key in "yrhuc". The remote server receives "Y" and send back Y-prefix prediction. This is a bad UX and causes extra network overhead to the remote server
Screenshot from #7
To suppress this behavior, the patch uses CompositionEvent to handle IME input. It will only send the compostion text to form INPUTs to match the prefix in the remote server.
Manual Testing @see #7
- Code Review
User interface changes
- No Changes
- (Reducing network requests in background)
- Added `compositionstart.autocomplete` event listener
- Added `compositionend.autocomplete` event listener
Data model changes