~eliasnaur/gio#178: 
wasm: Bug on CompositionStart/CompositionEnd in some devices?!

It's similar to https://todo.sr.ht/~eliasnaur/gio/166. But, now I take a look at the code and the root of the issue. But, I don't know how to fix that situation, without any side-effect/unintended-behaviour.

The problem comes from:

	w.addEventListener(w.tarea, "compositionstart", func(this js.Value, args []js.Value) interface{} {
		w.composing = true
		return nil
	})
	w.addEventListener(w.tarea, "compositionend", func(this js.Value, args []js.Value) interface{} {
		w.composing = false
		w.flushInput()
		return nil
	})

Link: https://git.sr.ht/~eliasnaur/gio/tree/master/app/internal/window/os_js.go#L203-218

Some keyboards (like the default from Xiaomi) will send a CompositionStart even when you are not typing special characters. Because of that, the input is ONLY updated when the space or return is pressed.

Other devices (such as iPhone and Chrome/Opera/Edge/Mozzila on Windows) doesn't use the CompositionStart, so the input works as expected.

Maybe we could support CompositionUpdateEvent (https://developer.mozilla.org/en-US/docs/Web/API/Element/compositionupdate_event ), but I not sure how it's different from InputEvent.

Status
REPORTED
Submitter
~inkeliz
Assigned to
No-one
Submitted
4 months ago
Updated
4 months ago
Labels
No labels applied.