facebook / facebook/lexical

Bug: Speech-to-text (dictation) on iOS deletes words after completion

Open
#6,940 1 comment 1 reaction 0 assignees View on GitHub
composition
Dominant language
TypeScript
Stars
23.9k
Forks
2.2k
Avg merge
1d 14h
Merged PRs (30d)
55

Description

Please see video.

Steps to replicate:

1. On iOS, open https://playground.lexical.dev/
2. Delete all the filler text
3. Hit the **system** microphone button on the keyboard (not lexical's microphone button)
4. Begin dictating, adding 2 sentences or so.
5. After you're done, hit the microphone button again to stop dictation.

At this point, you'll see a good amount of words disappear from the editor.

https://github.com/user-attachments/assets/04d0b9c9-36ba-4e04-8e59-ab8a917b4a2e

As a first step I'm just opening this ticket to increase exposure in case someone might obviously know what's wrong, before investigating deeper.

Via chatgpt, speech to text uses composition events compared to traditional keyboard input:

• Dictation uses composition events to handle intermediate input. These include:
• compositionstart: Marks the beginning of dictated input.
• compositionupdate: Fires as the text updates.
• compositionend: Finalizes the text input.
• Keyboard input usually doesn’t rely on compositionupdate.

https://github.com/facebook/lexical/blob/main/packages/lexical/src/LexicalEvents.ts#L899

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.