Skip to content

Commit 8602b9c

Browse files
committed
fix: aria attributes added to date and time inputs
1 parent 18d760c commit 8602b9c

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

src/customizations/volto/components/manage/Widgets/DatetimeWidget.jsx

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
/**
2+
* DatetimeWidget component.
3+
* @module components/manage/Widgets/DatetimeWidget
4+
*
5+
* https://github.com/plone/volto/blob/main/packages/volto/src/components/manage/Widgets/DatetimeWidget.jsx
6+
*
7+
* CUSTOMIZATIONS:
8+
* - accept calendar `openDirection` prop and use it in SingleDatePicker,
9+
* default to down if no openDirection is given
10+
* - requirement aria attributes added to date and time inputs - To be backported https://github.com/plone/volto/pull/7494
11+
*/
12+
13+
/**
14+
* DatetimeWidget component.
15+
* @module components/manage/Widgets/DatetimeWidget
16+
*/
17+
118
import React, { useState, useEffect } from 'react';
219
import PropTypes from 'prop-types';
320
import { defineMessages, useIntl } from 'react-intl';
@@ -203,10 +220,8 @@ const DatetimeWidgetComponent = (props) => {
203220
}
204221
}
205222

206-
// Aplica imediatamente
207223
applyAria();
208224

209-
// Cria observer apenas uma vez
210225
const observer = new MutationObserver(applyAria);
211226
observer.observe(document.body, { childList: true, subtree: true });
212227

0 commit comments

Comments
 (0)