mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Grafana UI: Add implicit submit to TimeRangeForm for A11y (#52647)
This commit is contained in:
@@ -109,12 +109,13 @@ export const TimeRangeForm: React.FC<Props> = (props) => {
|
||||
aria-label={selectors.components.TimePicker.calendar.openButton}
|
||||
icon="calendar-alt"
|
||||
variant="secondary"
|
||||
type="button"
|
||||
onClick={onOpen}
|
||||
/>
|
||||
);
|
||||
|
||||
return (
|
||||
<div>
|
||||
<form>
|
||||
<div className={style.fieldContainer}>
|
||||
<Field label="From" invalid={from.invalid} error={from.errorMessage}>
|
||||
<Input
|
||||
@@ -139,7 +140,7 @@ export const TimeRangeForm: React.FC<Props> = (props) => {
|
||||
</Field>
|
||||
{fyTooltip}
|
||||
</div>
|
||||
<Button data-testid={selectors.components.TimePicker.applyTimeRange} onClick={onApply}>
|
||||
<Button data-testid={selectors.components.TimePicker.applyTimeRange} type="submit" onClick={onApply}>
|
||||
Apply time range
|
||||
</Button>
|
||||
|
||||
@@ -154,7 +155,7 @@ export const TimeRangeForm: React.FC<Props> = (props) => {
|
||||
timeZone={timeZone}
|
||||
isReversed={isReversed}
|
||||
/>
|
||||
</div>
|
||||
</form>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user