From a89789df25b27f01be1a37de9b070915c14b9c74 Mon Sep 17 00:00:00 2001 From: Francisco Hodge Date: Sat, 24 Apr 2021 17:23:03 -0400 Subject: [PATCH] Adding selectionchange handler. Fixes https://github.com/hodgef/react-simple-keyboard/issues/1140 --- src/lib/components/Keyboard.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib/components/Keyboard.ts b/src/lib/components/Keyboard.ts index 5e7c18ff..bd594988 100644 --- a/src/lib/components/Keyboard.ts +++ b/src/lib/components/Keyboard.ts @@ -1008,6 +1008,7 @@ class SimpleKeyboard { document.addEventListener("mouseup", this.handleMouseUp); document.addEventListener("touchend", this.handleTouchEnd); document.addEventListener("select", this.handleSelect); + document.addEventListener("selectionchange", this.handleSelect); } } @@ -1135,6 +1136,7 @@ class SimpleKeyboard { document.removeEventListener("mouseup", this.handleMouseUp); document.removeEventListener("touchend", this.handleTouchEnd); document.removeEventListener("select", this.handleSelect); + document.removeEventListener("selectionchange", this.handleSelect); document.onpointerup = null; document.ontouchend = null; document.ontouchcancel = null;