Skip to content

Commit

Permalink
fix: only hide the native cursor if plugin enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
ocavue committed Nov 22, 2022
1 parent e38ea46 commit 5bbadc1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ export function createVirtualCursor(): Plugin {
}),
])
},

attributes: {
class: 'virtual-cursor-enabled',
},
},
})
}
Expand Down
4 changes: 3 additions & 1 deletion style/virtual-cursor.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
.ProseMirror-focused {
.ProseMirror.virtual-cursor-enabled {
/* Hide the native cursor */
caret-color: transparent;
}

.ProseMirror-focused {
/* Color of the virtual cursor */
--prosemirror-virtual-cursor-color: red;
}
Expand Down

0 comments on commit 5bbadc1

Please sign in to comment.