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
To change sort direction, define `direction` on `sortable-group` (default is `y`):
@@ -145,7 +146,7 @@ transition of `.125s` in the default case:
145
146
146
147
```css
147
148
.sortable-item {
148
-
transition: all.125s;
149
+
transition: all0.125s;
149
150
}
150
151
```
151
152
@@ -219,11 +220,11 @@ There is a service behind the scenes for communication between the group and the
219
220
Both the `{{sortable-group}}` and `{{sortable-item}}` take an additional argument `groupName`. Should you encounter this conflict, assign a `groupName` to the group and items. You only need to do this for one of the sortables in conflict, but you can on both if you wish.
@@ -232,20 +233,20 @@ Both the `{{sortable-group}}` and `{{sortable-item}}` take an additional argumen
232
233
Ensure that the same name is passed to both the group and the items, this would be best accomplished by creating property on the component and referring to that property. If you are able to use the `{{#let}}` helper (useful in template only components), using `{{#let}}` makes the usage clearer.
`sortable-item` exposes an optional `disabled` (previously `isDraggingDisabled`) flag that you can use to disable reordering for that particular item. Disabling and item won't prevent it from changing position in the array. The user can still move other non-disabled items to over it.
250
251
251
252
This flag is intended as an utility to make your life easier with 3 main benefits:
@@ -261,30 +262,35 @@ No data is mutated by `sortable-group` or `sortable-item`. In the spirit of “d
261
262
Each item takes a `model` property. This should be fairly self-explanatory but it’s important to note that it doesn’t do anything with this object besides keeping a reference for later use in `onChange`.
262
263
263
264
### Accessibility
265
+
264
266
The `sortable-group` has support for the following accessibility functionality:
265
267
266
268
#### Built-in Functionalities
267
269
268
270
##### Keyboard Navigation
271
+
269
272
There are 4 modes during keyboard navigation:
273
+
270
274
-**ACTIVATE**
271
275
enables the keyboard navigation.
272
-
Activate via `ENTER/SPACE`
276
+
Activate via `ENTER/SPACE`
273
277
-**MOVE**
274
278
enables item(s) to be moved up, down, left, or right based on `direction`.
275
-
Activate via `ARROW UP/DOWN/LEFT/RIGHT`
279
+
Activate via `ARROW UP/DOWN/LEFT/RIGHT`
276
280
-**CONFIRM**
277
281
submits the new sort order, invokes the `onChange` action.
278
-
Activate via `ENTER/SPACE`.
282
+
Activate via `ENTER/SPACE`.
279
283
-**CANCEL**
280
284
cancels the new sort order, reverts back to the old sort order.
281
-
Activate via `ESCAPE` or when `focus` is lost.
285
+
Activate via `ESCAPE` or when `focus` is lost.
282
286
283
287
##### Focus Management
288
+
284
289
- When `focus` is on a `item` or `handle`, user can effectively select the `item` via `ENTER/SPACE`. This is the `ACTIVATE` mode.
285
290
- While `ACTIVATE`, the `focus` is locked on `sortable-group` container and will not be lost until `CONFIRM`, `CANCEL`, or `focus` is lost.
286
291
287
292
#### User configurable
293
+
288
294
##### Screen Reader
289
295
290
296
The default language for `ember-sortable` is English. Any language can be supported by passing in the configuration below in the appropriate language.
@@ -293,18 +299,21 @@ The default language for `ember-sortable` is English. Any language can be suppor
293
299
a name for the item. Defaults to `item`.
294
300
-**a11yAnnouncementConfig**
295
301
a map of `action enums` to `functions` that takes the following `config`, which is exposed by `sortable-group`.
302
+
296
303
```javascript
297
304
a11yAnnounceConfig = {
298
305
a11yItemName, // name associated with the name
299
306
index, // 0-based
300
307
maxLength, // length of the items
301
308
direction, // x or y
302
309
delta, // +1 means down or right, -1 means up or left
303
-
}
310
+
};
304
311
```
312
+
305
313
and returns a `string` constructed from the `config`.
306
314
307
315
**Default value**
316
+
308
317
```javascript
309
318
{
310
319
ACTIVATE:function({ a11yItemName, index, maxLength, direction }) {
@@ -332,6 +341,7 @@ and returns a `string` constructed from the `config`.
332
341
```
333
342
334
343
##### Visual Indicator
344
+
335
345
-**handleVisualClass**
336
346
This class will be added to the `sortable-handle` during `ACTIVATE` and `MOVE` operations. This allows you to add custom styles such as `visual arrows` via `pseudo` classes.
337
347
@@ -342,9 +352,9 @@ and returns a `string` constructed from the `config`.
342
352
343
353
`ember-sortable` exposes some acceptance test helpers:
344
354
345
-
*[`drag`][drag]: Drags elements by an offset specified in pixels.
346
-
*[`reorder`][reorder]: Reorders elements to the specified state.
347
-
*[`keyboard`][keyboard]: Keycode constants for quick.
355
+
-[`drag`][drag]: Drags elements by an offset specified in pixels.
356
+
-[`reorder`][reorder]: Reorders elements to the specified state.
357
+
-[`keyboard`][keyboard]: Keycode constants for quick.
348
358
349
359
[drag]: addon-test-support/helpers/drag.js
350
360
[reorder]: addon-test-support/helpers/reorder.js
@@ -353,32 +363,35 @@ and returns a `string` constructed from the `config`.
353
363
To include them in your application, you can import them:
0 commit comments