Highlighted selection - not to lose focus when focusing on other element on the page #4963
Replies: 3 comments 3 replies
-
I'm interested in this as well. I have a similar use case, how I want to solve it for now is that I apply a mark extension (like highlight) to the selection and I make sure to remove it when I'm done with these other steps. But I'm not very happy with this approach because it has a lot of pitfalls, like preserving these marks to the db, not removing them correctly, etc. |
Beta Was this translation helpful? Give feedback.
-
@demiro @abecirovic3 Hi, Is there a solution to this problem? |
Beta Was this translation helpful? Give feedback.
-
found this code and updated it a bit and it seems to work fine
|
Beta Was this translation helpful? Give feedback.
-
I know it sounds a bit confusing...
but inherently the selection get lost when you focus on another element
imagine this scenario:
user selects some text
clicks on a chatbot window and ask the bot something related to the selection
obviously as soon as you click into checkbox window, the editor's selection gets lost.... but, is it possible to wrap the whole selection in a special ..., and when I select something else, it gets unwrapped?
I saw some other editors do it, not sure how would I go about it in tiptap? Is there an extension or command that would do that?
Beta Was this translation helpful? Give feedback.
All reactions