Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<C-d> in Safari on iPad does not work #115

Open
kometenstaub opened this issue Apr 23, 2023 · 4 comments
Open

<C-d> in Safari on iPad does not work #115

kometenstaub opened this issue Apr 23, 2023 · 4 comments

Comments

@kometenstaub
Copy link
Contributor

kometenstaub commented Apr 23, 2023

<C-d> (Ctrl-d) in Safari on iPad does not work. (It should scroll down.)

It doesn't do anything the first time, the second time it deletes the whole line. It seems to me as if the Ctrl isn't recognised, and instead only the d is passed through, so it deletes the full line on second invocation, like dd.

I've tried it here: https://raw.githack.com/replit/codemirror-vim/noremap/dev/web-demo.html
I've used the keyboard from my MacBook with Apple's keyboard and mouse sharing feature.

macOS 13.3.1
iPadOS 16.4.1

<C-f> and others work, though. Might this be a conflict with Ctrl-d on iPadOS (the delete operation, the opposite of backspace)? On macOS, it is handled correctly in Safari.

@nightwing
Copy link
Collaborator

This is a bug in codemirror itself, as it does not handle keyboard modifiers on ios, and after user pressing ctrl-d, dispatches an event for simple d keydown see https://github.com/codemirror/view/blob/edb60581119d69d9d3b6bf246224268a36d0376b/src/input.ts#L196 which calls dispatchEvent with just a key, ignoring the modifiers

@kometenstaub
Copy link
Contributor Author

kometenstaub commented Apr 30, 2023

So why do other commands like C-f work?

What I’m trying to understanding is why some commands with Ctrl work, but this one doesn’t.

@nightwing
Copy link
Collaborator

This happens only for keys that change text in the editor. Try :map <C-k> rx and :map <C-j> rx. to see the difference.

@dansalvato
Copy link

Looks like this issue still persists (running the Obsidian iPad app in visionOS, which uses codemirror-vim for its Vim key bindings). Any recommended workarounds or known paths for this to be fixed? If this key modifier behavior is an iOS/iPadOS limitation, then that's understandable.

Backlink to the Obsidian bug report, for convenience: https://forum.obsidian.md/t/vim-mode-ctrl-d-navigation-is-still-broken-on-ipados/40262

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants