How do I select mark and delete it ?
See original GitHub issueThe docs only show the example of using onKeyDown: https://docs.slatejs.org/walkthroughs/using-plugins
Now, I read the mark from database, and show mark at startup.
The flow:
-
use external buttons(not keyCode) to add marks (I have done this, but there is a bug, if I use two different marker button to mark same selection, slate would broken ,I don’t know if it is relate to slate)
-
save mark info to db
-
When I meet this page again, read data from db, and rebuild marks.
-
How do I delete marks ???
currently I have to do as below
select the exactly text, and click the same mark button again to delete it.
the selection not show in my mark too, really not a good way.
I prefer click this mark, press Delete
key to delete it. But have no idea.
Issue Analytics
- State:
- Created 6 years ago
- Comments:5
Top Results From Across the Web
Delete marks for selected parts | Tekla User Assistance
To delete the marks, press Delete on the keyboard, or right-click in the drawing and select Delete.
Read more >how to delete more than one photo at a time in Windows 10 ...
To select more than one item at a time: Hold down the CTRL key and click on the files or folders you want...
Read more >Deleting multiple selected images - Help Guide
Deletes the selected images. (1) Select the images to be deleted, then press on the center of the control wheel. The mark is...
Read more >Delete or hide photos and videos on iPhone - Apple Support
Delete : Tap Select, tap or drag your finger on the screen to select the items you want to delete, then tap the...
Read more >How Can I Bulk Select and Delete Photos? - MacMost
Instead of deleting them, mark each one. Then delete all of the marked ones, or the ones you've accumulated so far. There are...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey, I’ve also had this problem and it took me some time to get it working. I looked up the source code and found that removeMark is using removeMarkAtRange and value.selection as range. The problem is, like you have described, that if you just have your cursor within the mark and calling removeMark would not change anything because the value.selection is not expanded to the whole mark.
I solved the problem by going one by one to the left until there is no mark anymore in the current selection and then one by one to the right untill there is no mark anymore. Save the startPosition and endPosition in a var, select the range and call removeMark.
Here’s a snippet:
But, I agree, it should be easier to do.
I’m going to go ahead and close this issue since it’s gone stale. Feel free to follow up with a jsfiddle if you’re still stuck 🙂