Skip to content

Commit

Permalink
fix: visually hidden in toolbar
Browse files Browse the repository at this point in the history
  • Loading branch information
astagi committed Nov 7, 2024
1 parent 5bbe620 commit f0a5925
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/Toolbar/ToolbarItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ export interface ToolbarItemProps extends HTMLAttributes<HTMLElement> {
onClick?: (event: MouseEvent<HTMLAnchorElement>) => void;
}

const disabledMessage = ' elemento disabilitato';

function ToolbarItemLabel({
label,
size,
Expand All @@ -83,12 +81,11 @@ function ToolbarItemLabel({
const showSrText = size && size !== 'large';
if (disabled) {
if (!label || showSrText) {
return <span className='visually-hidden'>{disabledMessage}</span>;
return <span></span>;
}
return (
<>
<span className='toolbar-label'>{label}</span>
<span className='visually-hidden'>{disabledMessage}</span>
</>
);
}
Expand Down

0 comments on commit f0a5925

Please sign in to comment.