Skip to content

Commit 235163e

Browse files
committed
fix: refactor makeOverlaySelectable
1 parent 80eb5b5 commit 235163e

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

lib/datatip-manager.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -476,9 +476,8 @@ export class DataTipManager {
476476
invalidate: "never",
477477
})
478478

479-
// makes the text selectable with the help of user-select: text
480-
element.setAttribute("tabindex", "-1")
481-
overlayFocusFix(editor, element)
479+
//
480+
makeOverlaySelectable(editor, element)
482481

483482
editor.decorateMarker(overlayMarker, {
484483
type: "overlay",
@@ -522,6 +521,12 @@ export class DataTipManager {
522521
}
523522
}
524523

524+
/** makes the text selectable with the help of user-select: text */
525+
function makeOverlaySelectable(editor: TextEditor, overlayElement: HTMLElement) {
526+
overlayElement.setAttribute("tabindex", "-1")
527+
overlayFocusFix(editor, overlayElement)
528+
}
529+
525530
function overlayFocusFix(editor: TextEditor, element: HTMLElement) {
526531
const editorComponent = atom.views.getView(editor).getComponent()
527532
/**

0 commit comments

Comments
 (0)