Use mouseup intead of click for updateButtonState

This commit is contained in:
Henrik Giesel 2021-02-08 22:18:06 +01:00
parent a90931b91e
commit b56b3fd74a

View file

@ -151,7 +151,7 @@ export class EditingArea extends HTMLDivElement {
this.addEventListener("paste", onPaste); this.addEventListener("paste", onPaste);
this.addEventListener("copy", onCutOrCopy); this.addEventListener("copy", onCutOrCopy);
this.addEventListener("oncut", onCutOrCopy); this.addEventListener("oncut", onCutOrCopy);
this.addEventListener("click", updateButtonState); this.addEventListener("mouseup", updateButtonState);
const baseStyleSheet = this.baseStyle.sheet as CSSStyleSheet; const baseStyleSheet = this.baseStyle.sheet as CSSStyleSheet;
baseStyleSheet.insertRule("anki-editable {}", 0); baseStyleSheet.insertRule("anki-editable {}", 0);
@ -166,7 +166,7 @@ export class EditingArea extends HTMLDivElement {
this.removeEventListener("paste", onPaste); this.removeEventListener("paste", onPaste);
this.removeEventListener("copy", onCutOrCopy); this.removeEventListener("copy", onCutOrCopy);
this.removeEventListener("oncut", onCutOrCopy); this.removeEventListener("oncut", onCutOrCopy);
this.removeEventListener("click", updateButtonState); this.removeEventListener("mouseup", updateButtonState);
} }
initialize(color: string, content: string): void { initialize(color: string, content: string): void {