You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit d7e3771
Browse filesBrowse the repository at this point in the historyBrowse files
feat(List): onReorder reorders rows the way an iOS table does
List takes onReorder(fromIndex, toIndex): each row gets a trailing reorder
handle, and ListItem's isReorderDisabled keeps a row in place (its end
content kept in line with the other rows'). A finger held still on a handle
for the scroll view's content-touch delay picks the row up (a flick on it
scrolls; two fingers are a pinch); the row follows the finger one to one,
opaque, the rows it passes slide out of its way on the table spring, the
page autoscrolls by whole points on a 20 ms clock near the edges, and the
drop springs from rest into its slot on a spring scaled by the distance
left. A dragged row stays inside its list. The motion is the same on every
touch screen (a coarse pointer); a mouse drags at once and rows take their
places without motion. The slide spring is read through its motion role
(resolveMotion), once per drag.
The handle's keys move the row, with Space and Escape to pick it up and put
it back; on a touch screen a key move slides its rows. Every move is
announced once the new order renders, and a declined one as kept. A focused
handle shows one whole ring, and the handle fits a compact row.
What runs only on a touch screen (the hold that claims a finger and the
springs) is ListReorderTouch.ts, imported by the reorder session alone. The
gesture host owns the document's touch listeners: the hold claims only a
lone finger (fingersDown) and asks the host to lock text selection under
the held finger (preventsTextSelection), so the handle keeps no selection
or callout styles of its own and a mouse keeps the page's selection. The
autoscroll runs on the shared edge autoscroll timer (utils/edgeAutoscroll.ts)
on UIKit's 20 ms clock. The values are in the UIKit constants table
(motion/uikit/reorder.ts), measured on iOS 26.2.
[feat]`List` takes `onReorder(fromIndex, toIndex)`: each row gets a reorder handle at its end, and `ListItem`'s new `isReorderDisabled` keeps a row in place. On a touch screen a finger held still on a handle picks up its row the way an iOS table's reorder control does (a flick on it still scrolls): the row follows the finger, the rows it passes slide out of its way, the page scrolls near the edges, and on release the row settles into its new place on UIKit's springs. A mouse drags a handle at once, and rows take their places without motion. From the keyboard, a handle's arrow keys, Home and End move its row, Space picks it up and Escape puts it back; every move is announced once it lands.
Copy file name to clipboardExpand all lines: packages/core/locales/en.json
+32Lines changed: 32 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -463,6 +463,38 @@
463
463
"defaultMessage": "{count, number} {count, plural, one {other} other {others}}",
464
464
"description": "Overflow element for the chat typing status when three or more people type: the first name is shown and the rest collapse into this phrase, which is then joined to the name by Intl.ListFormat. Renders as the last list item, e.g. \"Ana and 2 others\"."
465
465
},
466
+
"@astryx.list.reorderHandle": {
467
+
"defaultMessage": "Reorder {label}",
468
+
"description": "Accessible label on the handle at the end of a List row that drags the row to a new place or moves it with the arrow keys. `{label}` is the row's text (e.g. \"Reorder Inbox\")."
"description": "Accessible label on a List row's reorder handle when the row has no text label to name it after. `{position}` is the row's 1-based place in the list (e.g. \"Reorder item 3\")."
473
+
},
474
+
"@astryx.list.reorderHint": {
475
+
"defaultMessage": "Drag to move this item, or press Arrow Up or Arrow Down. Press Space to pick it up and Escape to put it back.",
476
+
"description": "Description read after the label of every reorder handle in a List: how to move a row by dragging or from the keyboard."
477
+
},
478
+
"@astryx.list.reorderPosition": {
479
+
"defaultMessage": "Position {position, number} of {total, number}",
480
+
"description": "Screen-reader announcement each time a row being reordered in a List reaches a new place. `{position}` is its 1-based place, `{total}` the number of rows."
481
+
},
482
+
"@astryx.list.reorderPickedUp": {
483
+
"defaultMessage": "Picked up, position {position, number} of {total, number}. Press Arrow Up or Arrow Down to move, Space to drop, Escape to cancel.",
484
+
"description": "Screen-reader announcement when a List row's reorder handle picks the row up from the keyboard. `{position}` is the row's 1-based place, `{total}` the number of rows."
485
+
},
486
+
"@astryx.list.reorderDropped": {
487
+
"defaultMessage": "Dropped, position {position, number} of {total, number}",
488
+
"description": "Screen-reader announcement when a row being reordered in a List is dropped. `{position}` is its new 1-based place, `{total}` the number of rows."
489
+
},
490
+
"@astryx.list.reorderCancelled": {
491
+
"defaultMessage": "Reorder cancelled, back to position {position, number} of {total, number}",
492
+
"description": "Screen-reader announcement when a reorder in a List is cancelled and the row returns to where it was. `{position}` is that 1-based place, `{total}` the number of rows."
493
+
},
494
+
495
+
496
+
497
+
466
498
"@astryx.listInput.emptyTitle": {
467
499
"defaultMessage": "No {itemName}s yet",
468
500
"description": "EmptyState title shown inside a lab ListInput when its collection has no records. `{itemName}` is the consumer's singular noun for one record (e.g. \"guest\"); the source appends a literal \"s\" to pluralize it, which only works for regular English plurals. If your language cannot pluralize an interpolated noun this way, rephrase around `{itemName}` instead (e.g. \"No {itemName} added yet\")."
Copy file name to clipboardExpand all lines: packages/core/src/List/List.doc.mjs
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -53,6 +53,12 @@ export const docs = {
53
53
description: "With hasAnimatedChanges, page content below the list moves with its rows (a transient translate, cleared at rest) instead of jumping when the list changes height, each piece by what layout moved it. While it moves, that translate makes it the containing block of any position: fixed element inside it. Use 'stays' to keep it still when the app manages that area itself.",
"Makes the rows reorderable: each row gets a reorder handle at its end, and a ListItem with isReorderDisabled keeps its place instead. Called with a row's index before and after a move; render the rows in the new order to apply it. On a touch screen, a finger held still on a handle for a moment picks up its row (a flick on it still scrolls): the row follows the finger, the rows it passes slide out of its way, the page scrolls near the edges, and on release the row settles into its new place on UIKit's springs, as an iOS table reorders. A mouse drags a handle at once, and the rows take their places without motion. From the keyboard, a handle's arrow keys move its row one place, Home and End to either end; Space picks it up and Escape puts it back. Every move is announced once the new order renders; a move you decline (by keeping the order) is announced as cancelled. A disabled row's handle stays focusable but moves nothing.",
Copy file name to clipboardExpand all lines: packages/core/src/List/ListItem.doc.mjs
+9Lines changed: 9 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -107,6 +107,13 @@ export const docs = {
107
107
description: 'Selected state; marks the item as the current one with aria-current="true" (a list item cannot carry aria-selected).',
108
108
default: 'false',
109
109
},
110
+
{
111
+
name: 'isReorderDisabled',
112
+
type: 'boolean',
113
+
description:
114
+
"In a List with onReorder, this row has no reorder handle and keeps its place: other rows cannot be dragged or moved past it, so it splits the list into groups that each reorder on their own. Its end content stays in line with the other rows' (the handle's place is kept empty). No effect elsewhere.",
0 commit comments