fix(web): hide citation measurement items from assistive tech (#40203)

This commit is contained in:
yyh
2026-08-10 02:34:14 +00:00
committed by GitHub
parent f8d381e6c5
commit e7f789f185
2 changed files with 4 additions and 1 deletions
@@ -96,7 +96,9 @@ describe('Citation', () => {
]}
/>,
)
expect(screen.getAllByTestId('citation-measurement-item')).toHaveLength(2)
const measurementItems = screen.getAllByTestId('citation-measurement-item')
expect(measurementItems).toHaveLength(2)
measurementItems.forEach((item) => expect(item).toHaveAttribute('aria-hidden', 'true'))
})
it('should display the document name inside each measurement item', () => {
@@ -86,6 +86,7 @@ const Citation: FC<CitationProps> = ({
{resources.map((res, index) => (
<div
key={res.documentId}
aria-hidden
data-testid="citation-measurement-item"
className="absolute top-0 left-0 -z-10 mr-1 mb-1 h-7 w-auto max-w-60 pr-2 pl-7 text-xs whitespace-nowrap opacity-0"
ref={(ele: HTMLDivElement | null) => {