[Editor] Disable context menu on alt-text button and in the associated dialog
but keep it for the text area. Disable pointerdown on the alt-text button to disable dragging the editor when the button is clicked (especially when slightly moving the mouse between the down and the up).
This commit is contained in:
parent
85568bd6cc
commit
88f3ed7745
@ -834,6 +834,8 @@ class AnnotationEditor {
|
|||||||
altText.textContent = msg;
|
altText.textContent = msg;
|
||||||
altText.setAttribute("aria-label", msg);
|
altText.setAttribute("aria-label", msg);
|
||||||
altText.tabIndex = "0";
|
altText.tabIndex = "0";
|
||||||
|
altText.addEventListener("contextmenu", AnnotationEditor.#noContextMenu);
|
||||||
|
altText.addEventListener("pointerdown", event => event.stopPropagation());
|
||||||
altText.addEventListener(
|
altText.addEventListener(
|
||||||
"click",
|
"click",
|
||||||
event => {
|
event => {
|
||||||
|
@ -78,6 +78,11 @@ class AltTextManager {
|
|||||||
this.#container = container;
|
this.#container = container;
|
||||||
|
|
||||||
dialog.addEventListener("close", this.#close.bind(this));
|
dialog.addEventListener("close", this.#close.bind(this));
|
||||||
|
dialog.addEventListener("contextmenu", event => {
|
||||||
|
if (event.target !== this.#textarea) {
|
||||||
|
event.preventDefault();
|
||||||
|
}
|
||||||
|
});
|
||||||
cancelButton.addEventListener("click", this.#finish.bind(this));
|
cancelButton.addEventListener("click", this.#finish.bind(this));
|
||||||
saveButton.addEventListener("click", this.#save.bind(this));
|
saveButton.addEventListener("click", this.#save.bind(this));
|
||||||
optionDescription.addEventListener("change", this.#boundUpdateUIState);
|
optionDescription.addEventListener("change", this.#boundUpdateUIState);
|
||||||
|
Loading…
Reference in New Issue
Block a user