# gpui_web: Disable native canvas selection \(\#63877\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 13e5c99ab7c2f7c63102061bade5738c96cdd760

Requested commit: 13e5c99ab7c2f7c63102061bade5738c96cdd760

Commit: 13e5c99ab7c2f7c63102061bade5738c96cdd760

Tree: c5ceaeedf1683ae4927e6ebe4c73481e4c90bfbc

Author: Jakub Konka

Committer: GitHub

## Message

```
gpui_web: Disable native canvas selection (#63877)

Follow up on #63775: disabling WebKit touch callouts did not fully
prevent iOS Safari from selecting the entire GPUI canvas alongside the
app's text selection.

Remote Web Inspector captured a viewport-sized DOM range containing the
canvas while its computed `-webkit-touch-callout` was `none` but
`-webkit-user-select` was `text`. Set both standard and WebKit-prefixed
`user-select` to `none` directly when GPUI creates the canvas, without
relying on the embedding application's stylesheet. This leaves
touch-event handling and the hidden IME textarea unchanged.

Closes DEL-2016

## Validation

- On an iPhone, injecting ordinary inline `-webkit-user-select: none`
prevented the issue; switching it back to `text` reproduced it. No
`!important` was necessary. This tested the equivalent runtime style,
not a rebuilt app containing this commit.
- `cargo fmt -p gpui_web -- --check` passed.
- `RUSTC_BOOTSTRAP=1 cargo check -p gpui_web --target
wasm32-unknown-unknown` passed. The bootstrap flag is required by the
existing `wasm_thread` dependency.

Release Notes:

- Fixed unintended whole-canvas selection when long-pressing in GPUI web
applications on iOS.
```

## Parents

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

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