Skip to content

Commit

Permalink
Desktop: Resolves #11621: Accessibility: Add status update after upda…
Browse files Browse the repository at this point in the history
…te (#11634)
  • Loading branch information
pedr authored Jan 20, 2025
1 parent 0ac710e commit 157ad2c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/app-desktop/gui/NoteList/NoteList2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,9 @@ const NoteList = (props: Props) => {

const renderEmptyList = () => {
if (props.notes.length) return null;
return <div className="emptylist">{getEmptyFolderMessage(props.folders, props.selectedFolderId)}</div>;
// Role status is necessary for the screenreader to announce that the list is empty, since when there are
// zero items there is not list to render
return <div className="emptylist" role="status">{getEmptyFolderMessage(props.folders, props.selectedFolderId)}</div>;
};

const renderFiller = (key: string, style: React.CSSProperties) => {
Expand Down Expand Up @@ -306,6 +308,7 @@ const NoteList = (props: Props) => {
onKeyUp={onKeyUp}
onDrop={onDrop}
onContextMenu={onContainerContextMenu}
id='notes-list'
>
{renderEmptyList()}
{renderFiller('top', topFillerStyle)}
Expand Down
1 change: 1 addition & 0 deletions packages/app-desktop/gui/SearchBar/SearchBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ function SearchBar(props: Props) {
onKeyDown={onKeyDown}
onSearchButtonClick={onSearchButtonClick}
searchStarted={searchStarted}
aria-controls='notes-list'
/>
</Root>
);
Expand Down
2 changes: 2 additions & 0 deletions packages/app-desktop/gui/lib/SearchInput/SearchInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ interface Props {
searchStarted: boolean;
placeholder?: string;
disabled?: boolean;
'aria-controls'?: string;
}

export interface OnChangeEvent {
Expand Down Expand Up @@ -79,6 +80,7 @@ export default function(props: Props) {
onKeyDown={props.onKeyDown}
spellCheck={false}
disabled={props.disabled}
aria-controls={props['aria-controls']}
/>
<SearchButton
aria-label={iconLabel}
Expand Down

0 comments on commit 157ad2c

Please # to comment.