jmuehlner commented on code in PR #886:
URL: https://github.com/apache/guacamole-client/pull/886#discussion_r1227130538
##########
guacamole-common-js/src/main/webapp/modules/Keyboard.js:
##########
@@ -1381,24 +1380,37 @@ Guacamole.Keyboard = function Keyboard(element) {
if (!markEvent(e)) return;
// Type all content written
- if (e.data && !e.isComposing) {
- element.removeEventListener("compositionend",
handleComposition, false);
+ if (e.data && !e.isComposing)
guac_keyboard.type(e.data);
- }
- };
+ }
+
+ /**
+ * Handles the given "compositionstart" event, automatically removing
+ * the "input" event handler, as "input" events should only be handled
+ * IFF composition events are not provided by the browser.
+ *
+ * @private
+ * @param {!CompositionEvent} e
+ * The "compositionstart" event to handle.
+ */
+ var handleCompositionStart = function handleCompositionStart(e) {
+
+ // Remove the "input" event handler now that the browser is known
+ // to send composition events
+ element.removeEventListener("input", handleInput, false);
Review Comment:
It's actually import to skip the `markEvent` test that the other handlers do
in this case. When testing against
https://guacamole.apache.org/pub/tests/guac/keyboard-test, this caused the
input handler to be removed from the static textarea, but NOT the textarea
created by `InputSink`, resulting in duplicate key events.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]