Clicking anywhere on the placeholder text on Chrome Android won't pop up the virtual keyboard

If you’re using CodeMirror 6 and you try to click on the placeholder text made by the placeholder extension, the keyboard will never show up. I’ve only been able to observe this on the Chrome version listed and only on Android. Chrome desktop, Firefox Android, and Safari iOS don’t exhibit this behavior and instead, clicking the placeholder will open the keyboard. (With the exception of Chrome desktop, since that doesn’t have a virtual keyboard, but text input still works.)

Sandbox link: Placeholder Android Bug - CodeSandbox
Android Chrome version: 91.0.4472.120

I’m not entirely sure how Codesandbox works, but that Codesandbox link gives this URL (https://ws4kj.csb.app/) as the link to load that code in the browser, and so I’ve been able to reproduce it by loading that link on my Android phone.

You can also reproduce this with my application Lyricistant at https://dev.lyricistant.app but the code for that is obviously much more complicated than the code in the sandbox.

I can upload a video of the effect, if needed.

This appears to be related to the fact that the cursor is next to an uneditable element (the placeholder). I’m seeing it occur a little different (the keyboard appears, but immediately disappears again when I try to type something).

I’m considering a new hack for this type of bugs, but I haven’t implemented it yet and I’m not sure if it’ll actually solve this one, but I have hope it might.

1 Like

Yeah, this seems like a real tough one. Thanks so much for taking a look! Let me know if there’s anything I can do to help!

I’m not able to reproduce this anymore with the current @codemirror/view . (The cursor is drawn in an odd place with a huge placeholder, which I’m looking into.)