Wizard: fix datepicker reset glitch (MS-8610)

If the reset button is clicked, there is a glitch that shows error state
for a moment. This commit removes the glitch by setting the snapshot
date even for invalid values, and removes the workaround that was
previously added.
This commit is contained in:
Anna Vítová 2025-05-29 16:47:43 +02:00 committed by Anna Vítová
parent a93a163afb
commit 6ec6f33fda
3 changed files with 10 additions and 7 deletions

View file

@ -138,10 +138,7 @@ export default function Snapshot() {
onClick={async () => {
//Patternfly DatePicker seems to only clear error text if value is reset to '',
// if you have an invalid date (2000-01-010000) and try to reset it, it must be set to '' first
dispatch(changeSnapshotDate(''));
setTimeout(() => {
dispatch(changeSnapshotDate(yyyyMMddFormat(new Date())));
}, 1);
dispatch(changeSnapshotDate(yyyyMMddFormat(new Date())));
}}
>
Reset