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
Closed
Changes from 3 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
Original file line number Diff line number Diff line change
@@ -39,6 +39,7 @@ export const RecordTableCellEditMode = ({
<StyledEditableCellEditModeContainer
ref={refs.setReference}
data-testid="editable-cell-edit-mode-container"
role="combobox"
malomarrec marked this conversation as resolved.
Show resolved Hide resolved
>
<OverlayContainer ref={refs.setFloating} style={floatingStyles}>
{children}
Original file line number Diff line number Diff line change
@@ -8,7 +8,6 @@ import { useDropdown } from '@/ui/layout/dropdown/hooks/useDropdown';

import { CurrencyPickerHotkeyScope } from '../types/CurrencyPickerHotkeyScope';

import { CurrencyPickerDropdownSelect } from './CurrencyPickerDropdownSelect';

const StyledDropdownButtonContainer = styled.div`
align-items: center;
@@ -84,11 +83,13 @@ export const CurrencyPickerDropdownButton = ({
</StyledDropdownButtonContainer>
}
dropdownComponents={
<CurrencyPickerDropdownSelect
currencies={currencies}
selectedCurrency={currency}
onChange={handleChange}
/>
<></>
// <CurrencyPickerDropdownSelect
// id="currency-picker-dropdown-options"
// currencies={currencies}
// selectedCurrency={currency}
// onChange={handleChange}
// />
}
dropdownPlacement="bottom-start"
dropdownOffset={{ x: 0, y: 4 }}
Original file line number Diff line number Diff line change
@@ -12,10 +12,12 @@ export const CurrencyPickerDropdownSelect = ({
currencies,
selectedCurrency,
onChange,
id
}: {
currencies: Currency[];
selectedCurrency?: Currency;
onChange: (currency: Currency) => void;
id?:string
}) => {
const [searchFilter, setSearchFilter] = useState<string>('');

@@ -32,7 +34,7 @@ export const CurrencyPickerDropdownSelect = ({
);

return (
<DropdownMenu>
<DropdownMenu id={id}>
<DropdownMenuSearchInput
value={searchFilter}
onChange={(event) => setSearchFilter(event.target.value)}
Original file line number Diff line number Diff line change
@@ -113,12 +113,14 @@ export const Dropdown = ({
<div
ref={refs.setReference}
onClick={handleClickableComponentClick}
aria-controls={dropdownId}
malomarrec marked this conversation as resolved.
Show resolved Hide resolved
>
{clickableComponent}
</div>
)}
{isDropdownOpen && (
<DropdownContent
id={"currency-picker-options"}
malomarrec marked this conversation as resolved.
Show resolved Hide resolved
className={className}
floatingStyles={floatingStyles}
dropdownMenuWidth={dropdownMenuWidth}
Original file line number Diff line number Diff line change
@@ -125,6 +125,7 @@ export const DropdownContent = ({
>
<OverlayContainer>
<DropdownMenu
id={dropdownId}
className={className}
width={dropdownMenuWidth ?? dropdownWidth}
data-select-disable
@@ -141,6 +142,7 @@ export const DropdownContent = ({
>
<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

className={className}
width={dropdownMenuWidth ?? dropdownWidth}
data-select-disable
Original file line number Diff line number Diff line change
@@ -67,6 +67,7 @@ export const MenuItemSelect = ({
selected={selected}
disabled={disabled}
hovered={hovered}
role="option"
malomarrec marked this conversation as resolved.
Show resolved Hide resolved
>
<MenuItemLeftContent LeftIcon={LeftIcon} text={text} />
{selected && <IconCheck size={theme.icon.size.md} />}
Original file line number Diff line number Diff line change
@@ -40,6 +40,7 @@ export const MenuItemSelectAvatar = ({
disabled={disabled}
hovered={hovered}
data-testid={testId}
role="option"
malomarrec marked this conversation as resolved.
Show resolved Hide resolved
malomarrec marked this conversation as resolved.
Show resolved Hide resolved
>
<StyledMenuItemLeftContent>
{avatar}
Loading