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

Template error reporting improvements #561

Merged
merged 8 commits into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
583 changes: 305 additions & 278 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "briskine",
"version": "7.14.0",
"version": "7.14.1",
"description": "Write everything faster.",
"private": true,
"type": "module",
Expand Down
14 changes: 7 additions & 7 deletions src/content/dialog/dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,13 +162,6 @@ function Dialog (originalProps) {
e.stopPropagation()
e.preventDefault()

// cache selection details, to restore later
const selection = getSelection(node)
anchorNode = selection.anchorNode
anchorOffset = selection.anchorOffset
focusNode = selection.focusNode
focusOffset = selection.focusOffset

// cache editor,
// to use for inserting templates or restoring later.
editor = document.activeElement
Expand All @@ -177,6 +170,13 @@ function Dialog (originalProps) {
editor = editor.shadowRoot.activeElement
}

// cache selection details, to restore later
const selection = getSelection(editor)
anchorNode = selection.anchorNode
anchorOffset = selection.anchorOffset
focusNode = selection.focusNode
focusOffset = selection.focusOffset

word = getSelectedWord({
element: editor
})
Expand Down
Loading
Loading