Closed distantnative closed 3 months ago
Fantastic, thanks for this fix, much appreciated! Shouldn't this be target at 4.3.1, though?
@bezin I only like to include fixes that are very simple in patch releases. When we're super sure of no regressions. As they don't get any release candidate.
I'm not that 100% sure with this one. So I rather want to include it in 4.4
Description
Summary of changes
DateInput.vue
does not use anymore the globalkeydown.cmd.s
event to commit unfinished input, but rather listens to the event locally, preventing propagation and only emits asubmit
event once the input value has been committed/transofrmed to a proper date time object and emitted/updated.Reasoning
keydown.cmd.s
event has been triggering theonBlur()
method no matter whether the date input was actually being edited or just present in the current view. We only need to trigger it when the input is currently being edited (as@blur
will take care of committing the value when the focus changes away from the input already).submit
event. We do not usethis.$events.emit("keydown.cmd.s")
as this triggers a race condition, where theinput
event is still propagating up the chain when the save would also happen. Emittingsubmit
ensures that this event has to travel up the same chain as theinput
event and thus they arrive in the right order.Changelog
Fixes
Cmd + S
/Ctrl + S
in nested structures/objects with date fields does not corrupt data anymore6390
Ready?
For review team