Skip to content

Commit f420622

Browse files
committed
fixup! ✨(frontend) improve NVDA navigation in DocShareModal
1 parent ec65514 commit f420622

File tree

4 files changed

+6
-11
lines changed

4 files changed

+6
-11
lines changed

src/frontend/apps/e2e/__tests__/app-impress/doc-editor.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -755,10 +755,9 @@ test.describe('Doc Editor', () => {
755755

756756
await expect(searchContainer.getByText(docChild1)).toBeVisible();
757757
await expect(searchContainer.getByText(docChild2)).toBeVisible();
758-
await expect(searchContainer.getByText(docChild2)).toBeVisible();
759758
await expect(searchContainer.getByText(randomDoc)).toBeHidden();
760759

761-
// use keydown to select the second result
760+
await page.keyboard.press('ArrowDown');
762761
await page.keyboard.press('ArrowDown');
763762
await page.keyboard.press('Enter');
764763

@@ -767,6 +766,7 @@ test.describe('Doc Editor', () => {
767766

768767
// Wait for the interlink to be created and rendered
769768
const editor = page.locator('.ProseMirror.bn-editor');
769+
770770
const interlink = editor.getByRole('link', {
771771
name: docChild2,
772772
});

src/frontend/apps/e2e/__tests__/app-impress/doc-member-create.spec.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,8 @@ test.describe('Document create member', () => {
2626

2727
await page.getByRole('button', { name: 'Share' }).click();
2828

29-
const inputSearch = page.getByRole('combobox', {
30-
name: 'Quick search input',
31-
});
29+
const inputSearch = page.getByTestId('quick-search-input');
30+
3231
await expect(inputSearch).toBeVisible();
3332

3433
// Select user 1 and verify tag

src/frontend/apps/impress/src/components/quick-search/QuickSearch.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,10 @@ export const QuickSearch = ({
4444
}: PropsWithChildren<QuickSearchProps>) => {
4545
const ref = useRef<HTMLDivElement | null>(null);
4646
const listId = useId();
47-
const hasResults = Boolean(children);
4847
const NO_SELECTION_VALUE = '__none__';
4948
const [userInteracted, setUserInteracted] = useState(false);
5049
const [selectedValue, setSelectedValue] = useState(NO_SELECTION_VALUE);
51-
const isExpanded = userInteracted && hasResults;
50+
const isExpanded = userInteracted;
5251

5352
const handleValueChange = (val: string) => {
5453
if (userInteracted) {
@@ -82,7 +81,6 @@ export const QuickSearch = ({
8281
onFilter={onFilter}
8382
placeholder={placeholder}
8483
listId={listId}
85-
hasResults={hasResults}
8684
isExpanded={isExpanded}
8785
onUserInteract={handleUserInteract}
8886
>

src/frontend/apps/impress/src/components/quick-search/QuickSearchInput.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ type Props = {
1717
children?: ReactNode;
1818
withSeparator?: boolean;
1919
listId?: string;
20-
hasResults?: boolean;
2120
onUserInteract?: () => void;
2221
isExpanded?: boolean;
2322
};
@@ -29,7 +28,6 @@ export const QuickSearchInput = ({
2928
children,
3029
withSeparator: separator = true,
3130
listId,
32-
hasResults,
3331
onUserInteract,
3432
isExpanded,
3533
}: Props) => {
@@ -65,7 +63,7 @@ export const QuickSearchInput = ({
6563
<Command.Input
6664
autoFocus={true}
6765
aria-label={t('Quick search input')}
68-
aria-expanded={isExpanded ?? hasResults}
66+
aria-expanded={isExpanded}
6967
aria-controls={listId}
7068
onClick={(e) => {
7169
e.stopPropagation();

0 commit comments

Comments
 (0)