Skip to content

fix(admin): label the allowed groups from the visible heading - #76

Open
karl-bullock wants to merge 2 commits into
fix/admin-settings-native-controlsfrom
fix/allowed-groups-aria-labelledby
Open

karl-bullock wants to merge 2 commits into
fix/admin-settings-native-controlsfrom
fix/allowed-groups-aria-labelledby

Conversation

@karl-bullock

Copy link
Copy Markdown
Member

Summary

The "Allowed user groups" block announced its heading twice: the container carried aria-label with a copy of the field heading, while the visible <label> had no for and named nothing.

The heading now carries an id and the group container is labelled by it (aria-labelledby), alongside the aria-describedby that already points at the help text. Screen readers announce the heading once and from the real element.

Follow-up to #72, branch built on it.

Changes

  • js/src/admin/components/CategoryEditorModal.tsx: second generateElementId() for the label, aria-labelledby instead of aria-label, role="group" and aria-describedby unchanged.
  • js/dist rebuilt.

Checks

  • npm run check-typings, npm run format-check, npm run build: clean.
  • Rendered container: role="group", aria-labelledby → the <label> id, aria-describedby → the help div id.

The group container carried aria-label with a copy of the field
heading, while the visible <label> had no `for`. Screen readers
announced the heading twice and the label element was never associated
with the control it names.

The heading now has an id and the container is labelled by it, next to
the aria-describedby that already points at the help text.
Includes transpiled JS/TS, and Typescript declaration files (typings).
@karl-bullock

Copy link
Copy Markdown
Member Author

Follow-up stacked on #72, one commit (0aa052d) plus its bundle.

What to look at:

  • Container attributes are now role="group", aria-labelledby → the visible <label>'s id, aria-describedby → the help div's id. Both ids come from separate generateElementId() calls on the modal instance.
  • Worth confirming: the heading is announced once (no leftover aria-label), and the ids stay unique when the modal is opened twice in one session.
  • role="group" and aria-describedby are unchanged from refactor(admin): use Flarum's own controls for the admin toggles #72; only the labelling changed.
  • Base is fix/admin-settings-native-controls. After refactor(admin): use Flarum's own controls for the admin toggles #72 merges this retargets to main and should still show only this one commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant