Skip to content

Commit fc44bc3

Browse files
authored
fix(DateTimeInput): a press in the time input keeps the preset-time list open (#9459)
* fix(DateTimeInput): a press in the time input keeps the preset-time list open The time list was a popover="auto" layer, and the browser's light dismiss counts a press in a text input as outside, so clicking into the time text closed the list the click had just opened. The list is now a manual popover that uses Layer's shared useOutsidePress: a press on the time field or in the list is inside (the list counts by its own layer id, since it may be hosted outside the field); a press anywhere else closes it; the existing blur close and Escape are unchanged. Records: component:DateTimeInput FR7 states the press rule and its verification row names the test; architecture:layer-runtime names the time list beside BaseTypeahead's and drops it from the auto-popover gap. Test: a press in the time input or the list keeps it open and a press elsewhere closes it (fails on main). * Merge branch 'main' into fix/datetimeinput-time-press-keeps-list
1 parent c117b0c commit fc44bc3

5 files changed

Lines changed: 114 additions & 38 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@astryxdesign/core': patch
3+
---
4+
5+
[fix] A press in a DateTimeInput's own time input no longer closes its open list of preset times. Clicking into the time text to fix a digit keeps the list showing; a press anywhere else on the page, moving focus away and Escape still close it.
6+
7+
@cixzhang

‎docs/architecture/layer-runtime.md‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -299,13 +299,13 @@ during a press so native light dismissal does not mistake them for outside
299299
interaction. Their click action is cancelled as an invoker toggle so the control
300300
can perform its own action without closing the layer.
301301

302-
A text input cannot be an invoker, so BaseTypeahead's list, which its text field
303-
owns, is a manual popover. A press that starts and ends on the field's input or
302+
A text input cannot be an invoker, so BaseTypeahead's list and DateTimeInput's
303+
time list, which their text fields own, are manual popovers. A press that starts and ends on the field's input or
304304
its buttons, or in the list, is inside, judged across open shadow roots; a press
305305
that starts and ends anywhere else closes the list, a scroll or pinch that
306306
starts outside does not, and Escape stays on the shared stack. Implementation
307-
gap: DateTimeInput's time list, DateInput's calendar and ChatComposerInput's
308-
trigger menu are still auto popovers with native light dismiss, so a press in
307+
gap: DateInput's calendar and ChatComposerInput's trigger menu are still auto
308+
popovers with native light dismiss, so a press in
309309
their own text input closes them.
310310

311311
### Current dismissal plumbing
@@ -332,7 +332,8 @@ Outside interaction is not coordinated by the shared stack. Current paths are
332332
independent:
333333

334334
- auto popovers use native light dismiss;
335-
- BaseTypeahead's list, a manual popover, uses Layer's outside-press watch,
335+
- BaseTypeahead's list and DateTimeInput's time list, manual popovers, use
336+
Layer's outside-press watch,
336337
which closes on a press that starts and ends outside the field and the list
337338
and forgets a cancelled press (a scroll);
338339
- native dialogs handle backdrop clicks locally;
@@ -651,7 +652,7 @@ staged as `[breaking]` (`spec:AST-017` FR32).
651652
- `Layer/useTouchTrigger.ts` owns touch trigger classification and the current
652653
touch-only outside listener for Tooltip/HoverCard.
653654
- `Layer/outsidePress.ts` owns the outside-press watch for a text field's
654-
manual layer, used by BaseTypeahead.
655+
manual layer, used by BaseTypeahead and DateTimeInput.
655656
- `DropdownMenuContext` and `DropdownMenuSubMenu` own the current local
656657
menu-cascade parent-close chain.
657658
- Dialog families own native modal/backdrop presentation and their local channel

0 commit comments

Comments
 (0)