Last active
June 11, 2020 11:07
-
-
Save CodHeK/447a5d158c1aa7ca5b9648c69209605b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$input.addEventListener('keydown', e => { | |
if(e.key === 'ArrowRight') { | |
$span.textContent = ''; // clear ghost span | |
$input.textContent = rest + suggestion; // fill the $input bar with required suggestion | |
// moves cursor to the end of the input box (won't go into the details of it) | |
setEndOfContenteditable($input); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment