Skip to content

Commit

Permalink
refactor: add dragging hint only on non-entered header cell
Browse files Browse the repository at this point in the history
- prevents duplicate SR output in entering the cell
  • Loading branch information
mgadewoll committed Sep 16, 2024
1 parent 46b8699 commit c63545a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/eui/src/components/datagrid/body/cell/focus_utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,17 +104,21 @@ export const FocusTrappedChildren: FunctionComponent<

cellEl.setAttribute(
'aria-describedby',
classNames(sortingId, ariaDescribedById, currentAriaDescribedbyId)
classNames(
sortingId,
ariaDescribedById,
!isCellEntered && currentAriaDescribedbyId
)
);

return () => {
if (currentAriaDescribedbyId) {
cellEl.setAttribute('aria-descibedby', currentAriaDescribedbyId);
cellEl.setAttribute('aria-describedby', currentAriaDescribedbyId);
} else {
cellEl.removeAttribute('aria-describedby');
}
};
}, [cellEl, ariaDescribedById]);
}, [cellEl, ariaDescribedById, isCellEntered]);

useEffect(() => {
if (isCellEntered) {
Expand Down

0 comments on commit c63545a

Please sign in to comment.