# gpui: Web text input improvements \(\#63201\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/224373ab888e873e19ad901dc0a8d4749ef032a3)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 224373ab888e873e19ad901dc0a8d4749ef032a3

Requested commit: 224373ab888e873e19ad901dc0a8d4749ef032a3

Commit: 224373ab888e873e19ad901dc0a8d4749ef032a3

Tree: b49629125f624572df483900eec05b4a69d30c89

Author: Cameron Mcloughlin

Committer: GitHub

## Message

```
gpui: Web text input improvements (#63201)

GPUI's keyboard handling on the web was previously managed with a hidden
`<input>`, and raw key events from this element were forwarded to GPUI's
key handling code.

However, this approach had some issues:
- it's not sufficient for key handling on android - gboard (the default
keyboard) does not produce raw key events, and instead presents as an
IME. The existing code did handle IMEs, but the implementation was
minimal, and didn't support gboard
- there was a bug relating to how state mapped between GPUI elements and
the underlying `<input>` that allowed for edits to be applied to stale
element text
- gboard seems to be picky about exactly how events are reported back,
and would lose state if we naively pass events back as soon as they are
ready. Now, we coalesce edits to the underlying `<textinput>` to at most
1 per JS event loop cycle

---

Release Notes:

- N/A or Added/Fixed/Improved ...
```

## Parents

- [0969b0dba3f3411592fce801d00f8d81b8dcf902](https://git.cafe/gitcafe/zed/commit/0969b0dba3f3411592fce801d00f8d81b8dcf902?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/224373ab888e873e19ad901dc0a8d4749ef032a3?format=markdown)
