Skip to content

Commit

Permalink
fix: selected node styles appear only if ProseMirror is focused (#138)
Browse files Browse the repository at this point in the history
Outline should be set only if ProseMirror is focused.
  • Loading branch information
rusandorx authored Oct 10, 2023
1 parent 198f805 commit dd873de
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
20 changes: 20 additions & 0 deletions src/extensions/base/BaseStyles/index.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
@use '../../../../node_modules/prosemirror-view/style/prosemirror';

// Make outline appear only if ProseMirror is focused

.ProseMirror-selectednode {
outline: none;
}

.li.ProseMirror-selectednode:after {
border: none;
}

.yfm-editor.ProseMirror-focused {
.ProseMirror-selectednode {
outline: 2px solid #8cf;
}

li.ProseMirror-selectednode:after {
border: 2px solid #8cf;
}
}

.yfm-editor.ProseMirror,
.yfm-editor .ProseMirror {
&:focus {
Expand Down
2 changes: 1 addition & 1 deletion src/extensions/behavior/Selection/selection.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.yfm-editor .pm-node-selected {
.yfm-editor.ProseMirror-focused .pm-node-selected {
box-shadow: var(--g-color-text-info) 0 0 0 1px;
}

0 comments on commit dd873de

Please sign in to comment.