Skip to content

Commit 19ffa09

Browse files
committed
fix: add userSelect override in makeOverlaySelectable
1 parent a62a5b0 commit 19ffa09

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/selectable-overlay.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
import { TextEditor, TextEditorComponent } from "atom"
22

3-
/** makes the text selectable with the help of `user-select: text` and `pointer-events: all` in CSS */
3+
/** makes the text selectable
4+
- You can directly add `user-select: text` and `pointer-events: all` in CSS for better performance
5+
*/
46
export function makeOverlaySelectable(editor: TextEditor, overlayElement: HTMLElement) {
57
overlayElement.setAttribute("tabindex", "-1")
8+
if (overlayElement.style.userSelect === "none") {
9+
overlayElement.style.userSelect = "text"
10+
}
611
overlayFocusFix(editor, overlayElement)
712
}
813

0 commit comments

Comments
 (0)