Skip to content

Commit

Permalink
CB-5133 add label for the expand button
Browse files Browse the repository at this point in the history
  • Loading branch information
devnaumov committed May 16, 2024
1 parent f925e56 commit 496e6d4
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { Clickable } from '../../Clickable';
import { getComputed } from '../../getComputed';
import { Icon } from '../../Icon';
import { Loader } from '../../Loader/Loader';
import { useTranslate } from '../../localization/useTranslate';
import { s } from '../../s';
import { useS } from '../../useS';
import { useStateDelay } from '../../useStateDelay';
Expand All @@ -30,6 +31,7 @@ interface Props {
}

export const TreeNodeExpand = observer<Props>(function TreeNodeExpand({ leaf, big, filterActive, disabled, className }) {
const translate = useTranslate();
const styles = useS(style);
const context = useContext(TreeNodeContext);

Expand Down Expand Up @@ -86,11 +88,16 @@ export const TreeNodeExpand = observer<Props>(function TreeNodeExpand({ leaf, bi
}
}

const title = translate('ui_expand');

return (
<Clickable
as="div"
role="button"
title={title}
aria-label={title}
className={s(styles, { treeNodeExpand: true, expanded: context.expanded, big }, className)}
focusable={!disabled && expandable}
focusable={expandable}
disabled={disabled || !expandable}
onClick={handleExpand}
onDoubleClick={handleDbClick}
Expand Down

0 comments on commit 496e6d4

Please sign in to comment.