Skip to content

Conversation

@sethhorsley
Copy link
Member

This pull request updates the combobox component to improve accessibility and user interaction by ensuring the popover's open/close state is consistently tracked and toggled. The main changes involve synchronizing the aria-expanded attribute with the popover state and refactoring the trigger action to toggle the popover instead of just opening it.

Accessibility and popover state management:

  • Added a new handlePopoverToggle method in combobox_controller.js to keep the aria-expanded attribute of the trigger element in sync with the popover's actual state.
  • Modified the popover's default attributes in combobox_popover.rb to trigger handlePopoverToggle when the popover is toggled.

Refactoring trigger and popover logic:

  • Changed the trigger's action in combobox_trigger.rb from openPopover to togglePopover, allowing users to both open and close the popover via the trigger.
  • Refactored the popover logic in combobox_controller.js by introducing a new togglePopover method, which checks the current state and calls either openPopover or closePopover as appropriate.

@sethhorsley sethhorsley requested a review from cirdes as a code owner October 19, 2025 09:43
Copy link
Collaborator

@cirdes cirdes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

really nice!!

@sethhorsley sethhorsley merged commit b7c025b into main Oct 20, 2025
2 checks passed
@sethhorsley sethhorsley deleted the fix-combobox-trigger-toggle branch October 20, 2025 20:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants