What’s broken?
At OpenProject, we're building an extension to have custom work package links for the BlockNote editor.
However, currently the behaviour when clicking on such an inline link is broken:
- The user expects after clicking on the element that when Ctrl-C and Ctrl-V are pressed, the work package link is copied
- The user expects after clicking on the element and pressing "del" or "backspace" that the element is removed from the document
It would be easy to solve both expectations, if we could select a single inline block. However, this is not possible at the moment via BlockNote, because it's not possible to select a single inline content.
Furthermore, when we force selection via ProseMirror, BlockNote opens a formatting toolbar. This toolbar does not make sense in our case, since you can't e.g. change font boldness or italics on our custom inline work package link.
What did you expect to happen?
What we need is:
- Be able to select a single inline element via
editor.setSelection
- Be able to pass in if we want the formatting toolbar to open or not, e.g. showFormattingToolbar: true|false
Steps to reproduce
- Write your own extension with inline elements
- Try
editor.setSelection on a single inline element
BlockNote version
0.51.3
Environment
No response
Additional context
We would like to solve this in a clean way 🙂 At the moment we're exploring the following options:
- Set selection via ProseMirror (solves our requirements but opens formatting toolbar)
- Attach our own handlers which intercept copy-paste, keypress etc. when the inline element was clicked (and remove the handlers when the focus is removed)
If you see other good ways to solve our problem, we're happy about suggestions!
Contribution
Sponsor
What’s broken?
At OpenProject, we're building an extension to have custom work package links for the BlockNote editor.
However, currently the behaviour when clicking on such an inline link is broken:
It would be easy to solve both expectations, if we could select a single inline block. However, this is not possible at the moment via BlockNote, because it's not possible to select a single inline content.
Furthermore, when we force selection via ProseMirror, BlockNote opens a formatting toolbar. This toolbar does not make sense in our case, since you can't e.g. change font boldness or italics on our custom inline work package link.
What did you expect to happen?
What we need is:
editor.setSelectionSteps to reproduce
editor.setSelectionon a single inline elementBlockNote version
0.51.3
Environment
No response
Additional context
We would like to solve this in a clean way 🙂 At the moment we're exploring the following options:
If you see other good ways to solve our problem, we're happy about suggestions!
Contribution
Sponsor