diff --git a/Gemfile.lock b/Gemfile.lock index f95bdc00eb..5c0f30b997 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -308,8 +308,8 @@ GEM highline (3.1.2) reline hiredis (0.6.3) - hiredis-client (0.25.2) - redis-client (= 0.25.2) + hiredis-client (0.25.3) + redis-client (= 0.25.3) hkdf (0.3.0) htmlentities (4.3.4) http (5.3.1) @@ -725,7 +725,7 @@ GEM reline redcarpet (3.6.1) redis (4.8.1) - redis-client (0.25.2) + redis-client (0.25.3) connection_pool regexp_parser (2.11.2) reline (0.6.2) diff --git a/app/javascript/mastodon/components/dropdown_menu.tsx b/app/javascript/mastodon/components/dropdown_menu.tsx index 8e765d1a65..42130ab597 100644 --- a/app/javascript/mastodon/components/dropdown_menu.tsx +++ b/app/javascript/mastodon/components/dropdown_menu.tsx @@ -186,13 +186,16 @@ export const DropdownMenu = ({ (e: React.MouseEvent | React.KeyboardEvent) => { const i = Number(e.currentTarget.getAttribute('data-index')); const item = items?.[i]; + const isItemDisabled = Boolean( + item && typeof item === 'object' && 'disabled' in item && item.disabled, + ); - onClose(); - - if (!item) { + if (!item || isItemDisabled) { return; } + onClose(); + if (typeof onItemClick === 'function') { e.preventDefault(); onItemClick(item, i); @@ -233,7 +236,7 @@ export const DropdownMenu = ({ onClick={handleItemClick} onKeyUp={handleItemKeyUp} data-index={i} - disabled={disabled} + aria-disabled={disabled} > @@ -320,7 +323,7 @@ export const DropdownMenu = ({ ); }; -interface DropdownProps { +interface DropdownProps { children?: React.ReactElement; icon?: string; iconComponent?: IconProp; @@ -348,7 +351,7 @@ interface DropdownProps { const offset = [5, 5] as OffsetValue; const popperConfig = { strategy: 'fixed' } as UsePopperOptions; -export const Dropdown = ({ +export const Dropdown = ({ children, icon, iconComponent, diff --git a/app/javascript/mastodon/components/status/boost_button.tsx b/app/javascript/mastodon/components/status/boost_button.tsx index b34988de47..7352c0c535 100644 --- a/app/javascript/mastodon/components/status/boost_button.tsx +++ b/app/javascript/mastodon/components/status/boost_button.tsx @@ -180,7 +180,7 @@ const ReblogMenuItem: FC = ({