Removed menu blinking in tables

This commit is contained in:
anareaty 2025-02-02 15:08:12 +04:00
parent 58b7b0659d
commit 145a264b7f
3 changed files with 3 additions and 3 deletions

View file

@ -12,6 +12,6 @@ The main reason you may want to use HTML checkboxes instead of Markdown checkbox
To create checkbox you should put cursor to the place you want and call the command "Add HTML checkbox". Alternatively you can select the option in the editor menu. Be aware that every created checkbox has a unic id, it is nesessary for the checkboxes to be clickable. Do not remove the id and also do not copy-paste checkboxes inside the same file, because if there are several checkboxes with the same id, they will not work. It is recommended to never edit checkboxes manually. Also checkboxes are NOT added automatically on the next line when you hit "enter". To create checkbox you should put cursor to the place you want and call the command "Add HTML checkbox". Alternatively you can select the option in the editor menu. Be aware that every created checkbox has a unic id, it is nesessary for the checkboxes to be clickable. Do not remove the id and also do not copy-paste checkboxes inside the same file, because if there are several checkboxes with the same id, they will not work. It is recommended to never edit checkboxes manually. Also checkboxes are NOT added automatically on the next line when you hit "enter".
When right-clicking on the checkbox you will see the menu allowing you to select between a few of alternate checkboxes (you will need the theme or special css to make alternate checkboxes look different). Note that not all of possble alternate checkboxes are supported, and I am not planning to add more. When the alternate checkboxes menu appears inside the table it will hide the default table right-click menu. I am aware that it may cause some blinking, but do not know how to fix it now. If you want to see table right-click menu, you should click on some other place in the cell. When right-clicking on the checkbox you will see the menu allowing you to select between a few of alternate checkboxes (you will need the theme or special css to make alternate checkboxes look different). Note that not all of possble alternate checkboxes are supported, and I am not planning to add more. When the alternate checkboxes menu appears inside the table it will hide the default table right-click menu. If you want to see table right-click menu, you should click on some other place in the cell.
Plugin works in embedded views as well, but clicking on checkboxes may cause some blinking in canvas. Plugin works in embedded views as well, but clicking on checkboxes may cause some blinking in canvas.

View file

@ -104,7 +104,7 @@ export default class HTMLCheckboxPlugin extends Plugin {
/* Add menu for alternative checkboxes */ /* Add menu for alternative checkboxes */
this.registerDomEvent(window, "mouseup", (e: MouseEvent) => { this.registerDomEvent(window, "mousedown", (e: MouseEvent) => {
if (e.button == 2) { if (e.button == 2) {
let target = e.target as HTMLElement let target = e.target as HTMLElement
if (target.localName == "input" && if (target.localName == "input" &&

View file

@ -1,7 +1,7 @@
{ {
"id": "html-checkboxes", "id": "html-checkboxes",
"name": "HTML checkboxes", "name": "HTML checkboxes",
"version": "1.0.1", "version": "1.0.2",
"minAppVersion": "0.15.0", "minAppVersion": "0.15.0",
"description": "Allows to quickly add HTML checkboxes to your notes and makes them clickable.", "description": "Allows to quickly add HTML checkboxes to your notes and makes them clickable.",
"author": "Anareaty", "author": "Anareaty",