Comments labels and hooks
Look up the labels, the keys, and the DOM hooks of the comments popover.
The comments popover takes its text from labels, opens with a key, and exposes DOM hooks for styling. The options are on Comments options.
Keyboard and DOM hooks
| Keys | Action |
|---|---|
| Shift+F2 | Opens the popover for the active cell. A cell without comments opens the composer. The keymap name is openComments. |
| Shift+F10 or the menu key | With DataGridContextMenu, opens the context menu. Its "Comments…" item opens the popover. |
| Mod+Enter | Submits the composer. |
| Escape | Cancels a delete confirm. Otherwise it closes the popover and keeps the comment draft. |
| Tab past the last control | Closes the popover. The Tab order goes on from the grid. |
The command openComments refuses holes and band rows. Viewing works on a read-only grid, and each write checks readOnly itself.
Labels
labels takes a partial DataGridCommentsLabels. A function label receives the values to insert, so a translation owns its plural form. The comments popover reads three layers. A later layer wins: the English defaults, the grid locale and labels.comments of the grid, then labels of the hook. locale sets the language of the comment times and follows the grid locale unless you set it.
| Label | Type | Use |
|---|---|---|
popover | (columnTitle, cellText) => string | The accessible name of the popover. |
locale | string | The locale of the comment times. |
commentList, composer, editComposer, composerPlaceholder | string | The list, the label of the new-comment and edit textareas, and the placeholder. |
submit, cancel, save, retry, discard, saveMine | string | Button text. |
editAction, deleteAction, confirmDeleteAction, resolveAction, reopenAction | string | Visible action text. |
edit, remove, confirmRemove, resolve, reopen | (name, time) => string | The accessible name of an action. name is "" for an anonymous comment. |
resolved, saving, loading, loadFailed, changedByOther, noComments | string | Status text. |
readOnlyHint, rowBusyHint, refused, failed | string | Hints and inline errors. |
counter | (used, max) => string | The length counter near the limit. |
menuItem | string | The context menu item. |
announce, announceCount, announceAdded | (count, unresolved, chord), (count, chord), (name) | The live region text. announceCount replaces announce when enableResolve is false. chord is "" without a binding. name is "" for an anonymous comment. |
unknownAuthor | string | The name of an author that has an id and no name. |
DOM hooks
| Hook | Where | Use |
|---|---|---|
data-grid-comment-marker | The corner element of a commented cell | Style the marker. It is aria-hidden. |
data-unresolved | The marker | Present while any comment of the cell is unresolved. Absent on the ring. |
data-grid-comments-popup | The popover popup | Style the popover. The grid ignores presses inside it. |
The marker uses bg-primary and border-primary. Set --data-grid-comment-marker-inset on the grid (default 0px) to move the marker away from the end edge, for example under an overlay scrollbar. It stays visible in forced-colors mode. Under a coarse pointer, its hit area grows to 24 px, and the drawn corner stays the same. className merges into the popover root.