Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
fix(collections/table): name a flag cell's checkbox after its column
Elian Dorand99f834af1d6
diff --git a/apps/client/src/widgets/collections/table/columns.spec.ts b/apps/client/src/widgets/collections/table/columns.spec.tsindex 04a149f6fb..b7ba33425b 100644--- a/apps/client/src/widgets/collections/table/columns.spec.ts+++ b/apps/client/src/widgets/collections/table/columns.spec.ts@@ -299,6 +299,7 @@ describe("buildColumnDefinitions — typed columns", () => {// A click writes the new value straight to the cell, which saves it as an edit.const unticked = checkboxOf(null);expect(unticked.checkbox.tabIndex).toBe(0);+ expect(unticked.checkbox.getAttribute("aria-label")).toBe("Done");act(() => unticked.checkbox.click());expect(unticked.setValue).toHaveBeenCalledExactlyOnceWith(true);diff --git a/apps/client/src/widgets/collections/table/columns.tsx b/apps/client/src/widgets/collections/table/columns.tsxindex 83fe23c9d9..07487da750 100644--- a/apps/client/src/widgets/collections/table/columns.tsx+++ b/apps/client/src/widgets/collections/table/columns.tsx@@ -652,6 +652,7 @@ function FlagFormatter({ cell }: FormatterOpts) {type="checkbox"checked={isSet}tabIndex={isEditable ? 0 : -1}+ aria-label={definition.title}aria-readonly={!isEditable}onClick={(e) => {if (!isEditable) e.preventDefault();