Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/selector-option-id-content-row.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@astryxdesign/core': patch
---

[docs] SelectorOption: the `ref` entry now says that a caller `id` lands on the content row, not on the option the listbox announces, so `aria-activedescendant` and `aria-controls` must not point at it. No behavior change.

@cixzhang
6 changes: 3 additions & 3 deletions packages/core/src/Selector/SelectorOption.doc.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const docs = {
name: 'ref',
type: 'React.Ref<HTMLElement>',
description:
"Ref to the row element. Other DOM, data, ARIA, style, class and event props reach the row too, except the ones the Selector option row and listbox own: `role`, `tabIndex`, `aria-selected`, `aria-disabled`, `aria-current` and `onClick`. Item's own `data-density` and `data-align` stay Item's. Selection is Selector's, and a click handler would add a second press target inside the option. Use Selector's `onChange`, or put a control in `endContent`.",
"Ref to the row element. Other DOM, data, ARIA, style, class and event props reach the row too, except the ones the Selector option row and listbox own: `role`, `tabIndex`, `aria-selected`, `aria-disabled`, `aria-current` and `onClick`. Item's own `data-density` and `data-align` stay Item's. A caller `id` lands on this content row, not on the option the listbox announces, so do not point `aria-activedescendant` or `aria-controls` at it. Selection is Selector's, and a click handler would add a second press target inside the option. Use Selector's `onChange`, or put a control in `endContent`.",
},
],
};
Expand Down Expand Up @@ -90,7 +90,7 @@ export const docsZh = {
name: 'ref',
type: 'React.Ref<HTMLElement>',
description:
'指向行元素的 ref。其他 DOM、data、ARIA、样式、class 和事件属性也会传到该行,但由 Selector 选项行和列表框负责的属性除外:`role`、`tabIndex`、`aria-selected`、`aria-disabled`、`aria-current` 和 `onClick`。Item 自身的 `data-density` 和 `data-align` 由 Item 保留。选择由 Selector 负责,点击处理函数会在选项内再加一个按压目标。请使用 Selector 的 `onChange`,或在 `endContent` 中放置控件。',
'指向行元素的 ref。其他 DOM、data、ARIA、样式、class 和事件属性也会传到该行,但由 Selector 选项行和列表框负责的属性除外:`role`、`tabIndex`、`aria-selected`、`aria-disabled`、`aria-current` 和 `onClick`。Item 自身的 `data-density` 和 `data-align` 由 Item 保留。调用方传入的 `id` 落在该内容行上,而不是列表框播报的选项上,因此不要让 `aria-activedescendant` 或 `aria-controls` 指向它。选择由 Selector 负责,点击处理函数会在选项内再加一个按压目标。请使用 Selector 的 `onChange`,或在 `endContent` 中放置控件。',
},
],
};
Expand All @@ -109,6 +109,6 @@ export const docsDense = {
layout:
"'stacked': description on its own line; 'inline': one line. A trigger value inside InputGroup is forced 'inline'.",
endContent: 'Additional content after label+description.',
ref: 'Ref to the row; other DOM/data/ARIA/style/class/event props reach it too, except role, tabIndex, aria-selected, aria-disabled, aria-current and onClick (Selector option row and listbox own them; Item keeps its data-density and data-align; use Selector onChange or a control in endContent).',
ref: 'Ref to the row; other DOM/data/ARIA/style/class/event props reach it too, except role, tabIndex, aria-selected, aria-disabled, aria-current and onClick (Selector option row and listbox own them; Item keeps its data-density and data-align; a caller id is on this content row, not the announced option, so never target it with aria-activedescendant/aria-controls; use Selector onChange or a control in endContent).',
},
};
Loading