You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When "Select All" is selected from a browser's "Edit" menu, it should behave the same as pressing the keyboard shortcut (Cmd/Ctrl+A): a selection should be created covering the whole doc.
This works as expected in Chrome and Firefox, and works as expected in all browsers when using the keyboard shortcut.
However, when "Select All" is selected from Safari's "Edit" menu, and the editor content is larger than the viewport, the cursor will be placed at the start or end of the document and no selection will be created.
Indeed, I can reproduce this. It appears to be caused by the presence of an uneditable element at the start or end of the document, which somehow breaks off Safari's native select-all. Unfortunately, it doesn't fire a beforeinput event when the user picks select-all. I'm not sure yet how we could detect this happening.
Good point about the uneditable element - it does seem to work as expected if the div with contenteditable=false is deleted.
It sounds like webkit bugs 108987 and 124765, perhaps (old but recently active).
There's also a related Chrome bug, but I haven't been able to reproduce that in CodeMirror, even when there are spacer contenteditable=false divs at both the start and end of the document.
Describe the issue
When "Select All" is selected from a browser's "Edit" menu, it should behave the same as pressing the keyboard shortcut (Cmd/Ctrl+A): a selection should be created covering the whole doc.
This works as expected in Chrome and Firefox, and works as expected in all browsers when using the keyboard shortcut.
However, when "Select All" is selected from Safari's "Edit" menu, and the editor content is larger than the viewport, the cursor will be placed at the start or end of the document and no selection will be created.
Browser and platform
Safari 16.2, macOS 13.1
Reproduction link
https://codemirror.net/try/?c=aW1wb3J0IHtiYXNpY1NldHVwLCBFZGl0b3JWaWV3fSBmcm9tICJjb2RlbWlycm9yIgppbXBvcnQge2phdmFzY3JpcHR9IGZyb20gIkBjb2RlbWlycm9yL2xhbmctamF2YXNjcmlwdCIKCm5ldyBFZGl0b3JWaWV3KHsKICBkb2M6ICJjb25zb2xlLmxvZygnaGVsbG8nKVxuIi5yZXBlYXQoMTAwMCksCiAgZXh0ZW5zaW9uczogW2Jhc2ljU2V0dXAsIGphdmFzY3JpcHQoKV0sCiAgcGFyZW50OiBkb2N1bWVudC5ib2R5Cn0pCg==
The text was updated successfully, but these errors were encountered: