fix: Today picks save end-of-day again, edits commit on editor close#12
Merged
Conversation
…r close The dedup in #11 moved the create form's Today snap from input time to submit time and then deleted it, so a picker Today click saved the current minute and expired the token instantly. The snap is back at its original site - the moment the picker fills the current minute - as one body-level delegate serving the form and every row editor, rewriting the field visibly; hand-typed other times never match it. Rows keep focus (any picker recommit of the current minute just re-enters the handler), while the form keeps the blur/showPicker reread dance. Trusted-keystroke testing also showed Chromium fires change per segment edit on a valid datetime-local, so the change trigger committed half-edited values and swapped the row mid-edit. Row edits now commit when the editor closes with a value different from what it opened with (focusout fires a custom commit trigger); unchanged closes are silent.
…n a Today fill showPicker() ran in the same tick the input flipped from display:none, so Chromium anchored the popup to a zero rect at the screen corner - focus and a forced layout read now precede it. And instead of leaving the open popup displaying a stale time after the snap, a row's Today fill commits immediately: the row re-renders to 11:59 PM and the popup closes with the swapped editor, so there is no mismatch window at all. The create form keeps its blur/showPicker reread dance.
…ting clicks A Today fill no longer commits and closes the editor out from under the user: rows now run the same snap dance the create form always has (rewrite the field, blur, showPicker) so the reopened picker shows 23:59 and stays interactive; a flag keeps the dance's blur from closing the editor. Commits happen when the user actually leaves: native focusout, or a body-level click-outside route for the post-dance state where the input is no longer focused. The poll pauses on an .editing marker instead of activeElement for the same reason. The display button and the editor also share one fixed footprint: swapping them used to reflow the row between mousedown and mouseup, so the click aimed at another row's edit button (or anything nearby) landed on nothing - which is why the editor 'would not open again'.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the Today-pick regressions reported on the deployed dashboard, in one coherent design instead of patches: rows now run the exact snap behavior the create form has had in production all along, and every editor transition was traced with real keystrokes.
The design (one behavior everywhere)
changeevents never commit (Chromium fires them on every keystroke of a valid value).showPicker(), so Chromium no longer anchors the popup to a pre-layout zero rect at the screen corner..editingmarker (activeElement stops being truthful after the dance).Verification (real CDP keystrokes, isolated browser, every transition instrumented)