Skip to content

Commit

Permalink
next: Listbox (#643)
Browse files Browse the repository at this point in the history
  • Loading branch information
huntabyte authored Aug 7, 2024
1 parent 797692d commit a37ff8c
Show file tree
Hide file tree
Showing 50 changed files with 2,911 additions and 1,955 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class CollapsibleRootState {
open: CollapsibleRootStateProps["open"];
disabled: CollapsibleRootStateProps["disabled"];
contentNode = $state<HTMLElement | null>(null);
contentId = $state<string | undefined>(undefined);

constructor(props: CollapsibleRootStateProps) {
this.open = props.open;
Expand Down Expand Up @@ -92,6 +93,7 @@ class CollapsibleContentState {
condition: () => this.present,
onRefChange: (node) => {
this.root.contentNode = node;
this.root.contentId = node?.id;
},
});

Expand Down Expand Up @@ -196,7 +198,7 @@ class CollapsibleTriggerState {
id: this.#id.current,
type: "button",
disabled: this.#isDisabled,
"aria-controls": this.#root.contentNode?.id,
"aria-controls": this.#root.contentId,
"aria-expanded": getAriaExpanded(this.#root.open.current),
"data-state": getDataOpenClosed(this.#root.open.current),
"data-disabled": getDataDisabled(this.#isDisabled),
Expand Down
Loading

0 comments on commit a37ff8c

Please sign in to comment.