KSubedi / transliteration-input-tools

Unofficial client to Google's Transliteration Backend
MIT License
41 stars 12 forks source link

Clicking back inside the text field should dismiss the suggestion #33

Closed AmalChandru closed 2 years ago

AmalChandru commented 3 years ago

Are there any suggestions on how to implement this? I think I have to edit handleKeyUp( ) from suggestion-box.ts . Little bit confused about how to listen to click events within the text field. Thanks in advance.

AmalChandru commented 2 years ago

Putting this here in hope of someone can make use of this.

window.addEventListener("click", (e) => { if (e.target.getAttribute("id") === "text-area") { document.querySelector(".ks-input-suggestions").classList.add("hidden"); } });