Fix/datepicker typed entry - #104
Merged
Merged
Conversation
… in-place edits Day and month swapped as soon as the entry ended: `dateFieldOrder` only ever looked at the resolved locale, never at `dateFormat`. A `fr-FR` formatter under an unconfigured `LOCALE_ID` (so `en-US`) displayed "08/07/2026" but read it back month-first — the auto-derived placeholder already advertised the formatter's own order. The order is now probed from that formatter's output for an illustrative date, and drives the parser, the live mask and the placeholder alike; the locale takes over when the format isn't numeric enough to probe. Correcting an already-typed segment shifted everything after it: replacing the month "07" with a single digit re-sliced the whole digit stream, turning "08/07/2026" into "08/12/026". The mask can only re-derive the field from a flat stream when typing forward (or deleting from the tail), so it now steps aside for the rest of the entry as soon as a keystroke lands anywhere but the tail — plain text, parsed on blur/Enter, exactly what already applied once a value existed. It re-arms on the next commit, or as soon as the field reads empty.
…anel `allowInput` is true by default, so the field is a text field first — but the whole trigger wrapper carried `(click)="open()"`, label and format hint included. Combined with the overlay's permanent backdrop, that made the field unusable with a mouse: the first click placed the caret, the next one was swallowed by the backdrop and lost focus without moving the caret, so correcting a single segment was impossible; a click on the label opened a panel `Escape` could no longer close (focus was nowhere inside the wrapper); and opening live-committed the typed text through `previewTyped`, disarming the auto-"/" mask mid-entry. The icon, `↓` and typing are unchanged. The click keeps opening the panel exactly where it's the affordance: a non-typeable trigger (`allowInput="false"`, `readonly`, `timeOnly`) and `showIcon="false"`, which leaves no icon to click.
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.
No description provided.