Bug: Speech-to-text (dictation) on iOS deletes words after completion
- 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
Assessment
This issue has not been assessed yet.