SecondHalfGames / yakui

yakui is a declarative Rust UI library for games
Apache License 2.0
230 stars 21 forks source link

IME: Using return key to commit text does not work #123

Open LPGhatguy opened 10 months ago

LPGhatguy commented 10 months ago

On my system, using the system IME to compose some characters and then hitting return results in the composition buffer being deleted and no text being inserted into the textbox. That's no good. I can still click options in the menu, which works, but it's not ideal.

I think this might be a race condition in our event handling.

stolen-programmer commented 10 months ago

I found the problem

When typing enter

Calling ctx.input.set_selection(None);

Causing loss of focus and subsequent commit event

https://github.com/SecondHalfGames/yakui/blob/main/crates/yakui-widgets/src/widgets/textbox.rs#L237