mirror of
https://github.com/langgenius/dify.git
synced 2026-09-21 05:11:22 +08:00
fix(web): hide citation measurement items from assistive tech (#40203)
This commit is contained in:
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user