ember-sortable 4.0.1 → 4.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/addon/modifiers/sortable-item.js +13 -7
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
+
|
|
6
|
+
## v4.0.2 (2022-10-06)
|
|
7
|
+
|
|
8
|
+
#### :bug: Bug Fix
|
|
9
|
+
* [#493](https://github.com/adopted-ember-addons/ember-sortable/pull/493) fix: Handle element in sortable item should be the most recent ([@nicolechung](https://github.com/nicolechung))
|
|
10
|
+
|
|
11
|
+
#### Committers: 1
|
|
12
|
+
- nicole chung ([@nicolechung](https://github.com/nicolechung))
|
|
13
|
+
|
|
5
14
|
## v4.0.1 (2022-10-03)
|
|
6
15
|
|
|
7
16
|
#### :memo: Documentation
|
|
@@ -268,6 +268,8 @@ export default class SortableItemModifier extends Modifier {
|
|
|
268
268
|
return;
|
|
269
269
|
}
|
|
270
270
|
|
|
271
|
+
this.setupHandleElement();
|
|
272
|
+
|
|
271
273
|
// If the event is coming from within the item, we do not want to activate keyboard reorder mode.
|
|
272
274
|
if (event.target === this.handleElement || event.target === this.element) {
|
|
273
275
|
this.sortableGroup.activateKeyDown(this);
|
|
@@ -811,6 +813,16 @@ export default class SortableItemModifier extends Modifier {
|
|
|
811
813
|
this.element.removeEventListener('touchstart', this.touchStart);
|
|
812
814
|
}
|
|
813
815
|
|
|
816
|
+
setupHandleElement() {
|
|
817
|
+
this.handleElement = this.element.querySelector(this.handle);
|
|
818
|
+
|
|
819
|
+
if (this.handleElement) {
|
|
820
|
+
this.handleElement.style['touch-action'] = 'none';
|
|
821
|
+
} else {
|
|
822
|
+
this.element.style['touch-action'] = 'none';
|
|
823
|
+
}
|
|
824
|
+
}
|
|
825
|
+
|
|
814
826
|
element;
|
|
815
827
|
didSetup = false;
|
|
816
828
|
|
|
@@ -827,13 +839,7 @@ export default class SortableItemModifier extends Modifier {
|
|
|
827
839
|
|
|
828
840
|
// Instead of using `event.preventDefault()` in the 'primeDrag' event,
|
|
829
841
|
// (doesn't work in Chrome 56), we set touch-action: none as a workaround.
|
|
830
|
-
this.
|
|
831
|
-
|
|
832
|
-
if (this.handleElement) {
|
|
833
|
-
this.handleElement.style['touch-action'] = 'none';
|
|
834
|
-
} else {
|
|
835
|
-
this.element.style['touch-action'] = 'none';
|
|
836
|
-
}
|
|
842
|
+
this.setupHandleElement();
|
|
837
843
|
|
|
838
844
|
if (!this.didSetup) {
|
|
839
845
|
this.addEventListener();
|