Fix text bug on iOS (#3423)

In this PR, we no longer buffer pointer down/ups. We now batch only
`pointer_move`, `wheel`, and `pinch` events.

Batched inputs were causing text not to work on iOS. On iOS, the
keyboard is only shown if we call `focus` during the same event loop as
a user input.

### Change Type
- [x] `sdk` — Changes the tldraw SDK
- [x] `bugfix` — Bug fix

### Test Plan

1. Use text on iOS.
pull/3429/head
Steve Ruiz 2024-04-09 16:30:33 +01:00 zatwierdzone przez GitHub
rodzic dadb57edcd
commit 988dbbde28
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
1 zmienionych plików z 7 dodań i 1 usunięć

Wyświetl plik

@ -8386,7 +8386,13 @@ export class Editor extends EventEmitter<TLEventMap> {
*/
dispatch = (info: TLEventInfo): this => {
this._pendingEventsForNextTick.push(info)
if (!(info.type === 'pointer' || info.type === 'wheel' || info.type === 'pinch')) {
if (
!(
(info.type === 'pointer' && info.name === 'pointer_move') ||
info.type === 'wheel' ||
info.type === 'pinch'
)
) {
this._flushEventsForTick(0)
}
return this