Skip to content

Commit d86027b

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

File tree

4 files changed

+8
-11
lines changed

4 files changed

+8
-11
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -763,15 +763,17 @@ test.describe('Doc Editor', () => {
763763
await expect(searchContainer.getByText(docChild2)).toBeVisible();
764764
await expect(searchContainer.getByText(randomDoc)).toBeHidden();
765765

766-
// use keydown to select the second result
767-
await page.keyboard.press('ArrowDown');
766+
// Navigate to second result (docChild2) and select it
767+
await page.keyboard.press('ArrowDown'); // Select first result (docChild1)
768+
await page.keyboard.press('ArrowDown'); // Select second result (docChild2)
768769
await page.keyboard.press('Enter');
769770

770771
// Wait for the search container to disappear, indicating selection was made
771772
await expect(searchContainer).toBeHidden();
772773

773774
// Wait for the interlink to be created and rendered
774775
const editor = page.locator('.ProseMirror.bn-editor');
776+
775777
const interlink = editor.getByRole('link', {
776778
name: docChild2,
777779
});

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)