Open
Bug 1993756
Opened 6 months ago
Refactor datetime-local picker's ARIA role management to avoid direct DOM manipulation by "TimePicker.init()"
Categories
(Core :: Layout: Form Controls, task)
Core
Layout: Form Controls
Tracking
()
NEW
People
(Reporter: ayeddi, Unassigned)
References
Details
Current behavior:
When a datetime-local input is displayed, the TimePicker.init() method manually adjusts ARIA roles and attributes for both the date picker and time picker components to avoid having two modal dialogs in one panel (lines 37–55 in toolkit/content/widgets/timepicker.js). By default, each date and time panels has its own role="dialog" aria-modal="true".
This approach works functionally but introduces several issues:
- The time picker is modifying the date picker’s ARIA attributes, creating unnecessary coupling between the two components
- The logic currently lives inside
TimePicker.init(), which is not the ideal location for managing panel-level structure and semantics - It performs DOM manipulation that should ideally be managed by the parent panel or container logic
Current implementation details:
When type="datetime-local":
TimePicker.init()changes both the time picker and date picker roles fromdialogtogroup- It removes
aria-modalfrom both picker panel elements - It sets the parent
datetime-pickercontainer torole="dialog"witharia-modal="true"
Desired behavior:
The ARIA role and attribute management should be centralized and handled in a more appropriate location, i.e.:
- In the
DateTimePickerPanel.sys.mjs(the panel controller), or - In the
datetimepicker.xhtmlinitialization code, or - Through a shared initialization pattern that ensures each picker manages its own semantics without directly modifying another component’s DOM.
Recommendation:
Refactor ARIA role management so that:
- The
TimePickerandDatePickercomponents remain self-contained and do not modify each other’s attributes. - The panel or container code is responsible for assigning the correct ARIA roles (
dialog,group) andaria-modalattributes based on context. - Future accessibility logic for modal and non-modal picker behavior can be extended cleanly without introducing cross-component dependencies.
Reference:
You need to log in
before you can comment on or make changes to this bug.
Description
•