Conversation
* fix: add dev warning when dialog has no accessible title
When a dialog is rendered without an aria-label, aria-labelledby, or a
visible title element, emit a console.warn in development mode to help
developers catch this common accessibility mistake early. The warning
fires once per dialog instance and is tree-shaken in production builds.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix(dialog): resolve test failures in dialog title dev warning
Check the DOM element directly for aria-label/aria-labelledby attributes
instead of relying on hook props, since wrapper components (e.g. RAC Dialog)
may add aria-labelledby from context after useDialog runs.
Add the warning pattern to the allowed warnings list in setupTests.js so
existing tests that render dialogs without accessible labels are not broken.
* fix: address review feedback - remove setupTests allowlist entry, drop 'visible' from warning
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: add aria-label to test dialogs that lack accessible titles
Adds aria-label="Test dialog" to Dialog test renders that don't
have a heading or aria-labelledby, preventing the new dev warning
from failing tests via failTestOnConsoleWarn().
9 test files fixed. Remaining failures (ContextualHelp, DatePicker,
DateRangePicker, Form, ListView) have dialogs rendered indirectly
through components — those need source-level changes.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: check props and titleId in addition to DOM attributes for dialog warning
The useEffect-based DOM check can race with useSlotId registration,
causing false positives in components where a heading exists but
hasn't registered yet.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: add aria-label to ContextualHelp dialog and revert ineffective titleId check
ContextualHelp renders <Header> (not <Heading>), so the Dialog's
useSlotId resolves to undefined and the dialog has no accessible
title. Pass the variant label ("Help"/"Information") as aria-label.
Reverts the !!titleId check in useDialog which didn't work because
useSlotId resolves to undefined via useLayoutEffect before the
warning's useEffect runs.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix contextual help usage
---------
Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Robert Snow <rsnow@adobe.com>
Co-authored-by: Robert Snow <snowystinger@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )