Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

accessibity: make drodpowns accessible #9136

Closed

Conversation

malomarrec
Copy link
Contributor

No description provided.

Copy link
Contributor

github-actions bot commented Dec 18, 2024

Welcome!

Hello there, congrats on your first PR! We're excited to have you contributing to this project.
By submitting your Pull Request, you acknowledge that you agree with the terms of our Contributor License Agreement.

Generated by 🚫 dangerJS against c66a3da

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This PR adds initial accessibility improvements to dropdown components by introducing ARIA attributes and roles, though several implementations are incomplete or need refinement.

  • Hardcoded ID "currency-picker-options" in Dropdown.tsx creates potential conflicts with multiple instances
  • Empty fragment in CurrencyPickerDropdownButton.tsx breaks currency selection functionality
  • Missing required ARIA attributes for role="combobox" in RecordTableCellEditMode.tsx
  • Incomplete ARIA implementation in MenuItemSelect.tsx - needs aria-selected and proper parent role="listbox"
  • Missing keyboard navigation handlers across dropdown components for proper accessibility compliance

💡 (1/5) You can manually trigger the bot by mentioning @greptileai in a comment!

7 file(s) reviewed, 6 comment(s)
Edit PR Review Bot Settings | Greptile

@malomarrec
Copy link
Contributor Author

@greptileai

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

(updates since last review)

This PR continues to improve dropdown accessibility with additional ARIA attribute implementations and role fixes, though some issues remain.

  • Inconsistent dropdown ID formatting between portal/non-portal versions in DropdownContent.tsx (${dropdownId}-"options" vs ${dropdownId}-options)
  • Missing required ARIA attributes for proper listbox accessibility in DropdownMenuItemsContainer.tsx (e.g., aria-orientation, aria-activedescendant)
  • Trailing space after hasMaxHeight prop in SingleRecordSelectMenuItems.tsx needs cleanup
  • Correctly added aria-selected and aria-disabled to MenuItemSelectAvatar.tsx for improved accessibility

8 file(s) reviewed, 8 comment(s)
Edit PR Review Bot Settings | Greptile

@@ -113,6 +113,9 @@ export const Dropdown = ({
<div
ref={refs.setReference}
onClick={handleClickableComponentClick}
aria-controls={`${dropdownId}-options`}
aria-expanded={isDropdownOpen}
role="combobox"
Copy link
Contributor

Choose a reason for hiding this comment

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

style: role='combobox' may not be appropriate here - combobox implies an input field with autocomplete/suggestions. Consider using role='button' with aria-haspopup='true' instead

@@ -117,7 +117,7 @@ export const SingleRecordSelectMenuItems = ({
resetSelectedItem();
}}
>
<DropdownMenuItemsContainer hasMaxHeight>
<DropdownMenuItemsContainer hasMaxHeight >
Copy link
Contributor

Choose a reason for hiding this comment

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

syntax: Trailing space after hasMaxHeight appears unintentional and should be removed

@@ -73,7 +73,7 @@ export const CurrencyPickerDropdownButton = ({

return (
<Dropdown
dropdownId="currency-picker-dropdown-id"
dropdownId={"currency-picker-dropdown-id"}
Copy link
Contributor

Choose a reason for hiding this comment

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

style: dropdownId should not be a string literal in curly braces - remove the curly braces

@@ -122,6 +122,8 @@ export const DropdownContent = ({
<StyledDropdownContentContainer
ref={floatingUiRefs.setFloating}
style={dropdownMenuStyles}
role="listbox"
id={`${dropdownId}-"options"`}
Copy link
Contributor

Choose a reason for hiding this comment

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

syntax: ID contains incorrect quote marks in string literal. Should be ${dropdownId}-options to match the portal version.

@@ -122,6 +122,8 @@ export const DropdownContent = ({
<StyledDropdownContentContainer
ref={floatingUiRefs.setFloating}
style={dropdownMenuStyles}
role="listbox"
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: role='listbox' requires child elements to have role='option' and aria-selected attributes for proper accessibility

Comment on lines +143 to +144
role="listbox"
id={`${dropdownId}-options`}
Copy link
Contributor

Choose a reason for hiding this comment

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

style: missing aria-activedescendant to indicate which option is currently focused in the listbox

>
<OverlayContainer>
<DropdownMenu
id={dropdownId}
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: id prop is only present in portal version but not in non-portal version - should be consistent

@@ -51,6 +51,7 @@ export const DropdownMenuItemsContainer = ({
<StyledDropdownMenuItemsExternalContainer
hasMaxHeight={hasMaxHeight}
className={className}
role="listbox"
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: listbox role requires child elements to have role='option'. Add aria-orientation='vertical' since this is a vertical listbox.

@malomarrec malomarrec marked this pull request as draft December 19, 2024 09:11
@malomarrec malomarrec closed this Dec 19, 2024
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.

1 participant