fix: Todo list items not showing as checked on Firefox

This commit is contained in:
Tom Moor
2022-02-12 08:45:04 -08:00
parent f4af702492
commit 7807e3ac03

View File

@@ -36,7 +36,7 @@ export default class CheckboxItem extends Node {
const input = document.createElement("span");
input.tabIndex = -1;
input.className = "checkbox";
input.ariaChecked = node.attrs.checked.toString();
input.setAttribute("aria-checked", node.attrs.checked.toString());
input.setAttribute("role", "checkbox");
input.addEventListener("click", this.handleClick);
@@ -75,7 +75,7 @@ export default class CheckboxItem extends Node {
if (result) {
const transaction = tr.setNodeMarkup(result.inside, undefined, {
checked: event.target.ariaChecked !== "true",
checked: event.target.getAttribute("aria-checked") !== "true",
});
view.dispatch(transaction);
}