#5130·slate

Android Predictive typing broken - Firefox

Author: KatTuriniCreated Sep 21, 2022Updated Jun 1, 2026
Labelsbug

Description Predictive typing on android - firefox is broken, inserting duplicates of entered letter sequences and losing focus, as visible in the recorded example of the slatejs.org/examples/richtext editor.

Apart from that, in my implementation of the editor (web app to be viewed on mobiles, too), when typing in Firefox (android), first word entered gets reversed, as the focus keeps jumping to the start of the editor - instead of 'Hello', the editor ends up with 'OLleh', plus an error message - 'type error - parentNode is null' pops up sometimes, as the focus keeps jumping to the start of the editor (video 2).

Issue with duplicating letter sequences is present on other android browsers too (chrome, duck duck go, samsung internet) - instead of reply, you end up with r+re+rep+repl+reply -> rrerepreply. Issue is especially bad on older androids - current android, current chrome - issue present only occasionally, usually when typing fast. Issue disappears if predictive typing is switched off.

From my observations, on slate 0.80.0, duplicating did not happen, but the currently predictive text would either overlay the placeholder (decorator) until empty space gets entered, which inserts the text to the editor, and last word would not get submitted (unless separated by empty space). Versions of slate from 0.81 up don't have this problem, but the duplication of letter sequences occurs.

Recording Firefox current, android current:

https://user-images.githubusercontent.com/46718908/191484822-452184f4-b56c-4a57-9425-1c634311b237.mov

Firefox current, android current:

https://user-images.githubusercontent.com/46718908/191487596-e5eb8de8-50e5-4383-b87c-c082163c1339.mov

Steps To reproduce the behavior:

  1. Go to slatejs.org/examples/richtext using an android device, browser Firefox (can be reproduced on browserstack)
  2. Click on editor
  3. Start typing
  4. See error

Expectation Letters are not duplicated Focus not getting reset/lost Type error is handled

Environment

  • Slate Version: current (my implementation,too)
  • Operating System: android 12 (and others)
  • Browser: firefox (current version); duplicate letters also on chrome, samsung internet, duck duck go..
  • TypeScript Version: 4.3 (in my implementation)

Context These problems are only present when predictive writing is enabled on android keyboards.