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 a361da6
Browse filesBrowse the repository at this point in the historyBrowse files
feat(List): a reorder handle's moves, and ListItem reorderLabel
Activating a reorderable List's handle without a drag (a tap, a click, a
screen reader's double tap) opens Move up, Move down, Move to top and Move
to bottom, each offered only when it moves the row, through the same moves
as the handle's keys: a row can be reordered with a single pointer and no
drag (WCAG 2.2 SC 2.5.7). A press that dragged the row opens nothing. The
menu is a DropdownMenu anchored over the handle, mounted only while it is
open (a mounted menu would lay out with every move of a dragged handle).
ListItem's new reorderLabel names the handle of a row whose label is not
plain text ("Reorder {reorderLabel}"); without it such a handle is named
after the row's place.
[feat] A reorderable `List`'s handle, activated without a drag (a tap, a click, a screen reader's double tap), opens its row's moves: Move up, Move down, Move to top and Move to bottom, each offered only when it moves the row, so a row can be reordered with a single pointer and no drag. `ListItem`'s new `reorderLabel` names the handle of a row whose label is not plain text.
Copy file name to clipboardExpand all lines: packages/core/locales/en.json
+16-4Lines changed: 16 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -491,10 +491,22 @@
491
491
"defaultMessage": "Reorder cancelled, back to position {position, number} of {total, number}",
492
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
493
},
494
-
495
-
496
-
497
-
494
+
"@astryx.list.reorderMoveUp": {
495
+
"defaultMessage": "Move up",
496
+
"description": "Item in the menu a List row's reorder handle opens when activated (tapped or clicked) instead of dragged: moves the row up one place."
497
+
},
498
+
"@astryx.list.reorderMoveDown": {
499
+
"defaultMessage": "Move down",
500
+
"description": "Item in the menu a List row's reorder handle opens when activated instead of dragged: moves the row down one place."
501
+
},
502
+
"@astryx.list.reorderMoveToTop": {
503
+
"defaultMessage": "Move to top",
504
+
"description": "Item in the menu a List row's reorder handle opens when activated instead of dragged: moves the row to the first place it can take."
505
+
},
506
+
"@astryx.list.reorderMoveToBottom": {
507
+
"defaultMessage": "Move to bottom",
508
+
"description": "Item in the menu a List row's reorder handle opens when activated instead of dragged: moves the row to the last place it can take."
509
+
},
498
510
"@astryx.listInput.emptyTitle": {
499
511
"defaultMessage": "No {itemName}s yet",
500
512
"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\")."
"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.",
60
+
"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. Activating a handle without dragging it (a tap, a click, a screen reader's double tap) opens its moves: Move up, Move down, Move to top and Move to bottom, each offered only when it moves the row. 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
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -114,6 +114,12 @@ export const docs = {
114
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.",
115
115
default: 'false',
116
116
},
117
+
{
118
+
name: 'reorderLabel',
119
+
type: 'string',
120
+
description:
121
+
'In a List with onReorder, the text this row\'s reorder handle is named after ("Reorder {reorderLabel}"), for a row whose label is not plain text. Without it such a handle is named after the row\'s place.',
0 commit comments