mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 11:41:20 +08:00
chore(reorder-group): correct typo in ReorderGroupState enum (#18017)
fixes #18016
This commit is contained in:
@ -3,7 +3,7 @@ import { Component, ComponentInterface, Element, Event, EventEmitter, Method, Pr
|
||||
import { Gesture, GestureDetail, ItemReorderEventDetail } from '../../interface';
|
||||
import { hapticSelectionChanged, hapticSelectionEnd, hapticSelectionStart } from '../../utils/haptic';
|
||||
|
||||
const enum ReordeGroupState {
|
||||
const enum ReorderGroupState {
|
||||
Idle = 0,
|
||||
Active = 1,
|
||||
Complete = 2
|
||||
@ -29,7 +29,7 @@ export class ReorderGroup implements ComponentInterface {
|
||||
private containerTop = 0;
|
||||
private containerBottom = 0;
|
||||
|
||||
@State() state = ReordeGroupState.Idle;
|
||||
@State() state = ReorderGroupState.Idle;
|
||||
|
||||
@Element() el!: HTMLElement;
|
||||
|
||||
@ -98,7 +98,7 @@ export class ReorderGroup implements ComponentInterface {
|
||||
}
|
||||
|
||||
private canStart(ev: GestureDetail): boolean {
|
||||
if (this.selectedItemEl || this.state !== ReordeGroupState.Idle) {
|
||||
if (this.selectedItemEl || this.state !== ReorderGroupState.Idle) {
|
||||
return false;
|
||||
}
|
||||
const target = ev.event.target as HTMLElement;
|
||||
@ -151,7 +151,7 @@ export class ReorderGroup implements ComponentInterface {
|
||||
|
||||
this.lastToIndex = indexForItem(item);
|
||||
this.selectedItemHeight = item.offsetHeight;
|
||||
this.state = ReordeGroupState.Active;
|
||||
this.state = ReorderGroupState.Active;
|
||||
|
||||
item.classList.add(ITEM_REORDER_SELECTED);
|
||||
|
||||
@ -187,9 +187,9 @@ export class ReorderGroup implements ComponentInterface {
|
||||
|
||||
private onEnd() {
|
||||
const selectedItem = this.selectedItemEl;
|
||||
this.state = ReordeGroupState.Complete;
|
||||
this.state = ReorderGroupState.Complete;
|
||||
if (!selectedItem) {
|
||||
this.state = ReordeGroupState.Idle;
|
||||
this.state = ReorderGroupState.Idle;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -212,7 +212,7 @@ export class ReorderGroup implements ComponentInterface {
|
||||
|
||||
private completeSync(listOrReorder?: boolean | any[]): any {
|
||||
const selectedItemEl = this.selectedItemEl;
|
||||
if (selectedItemEl && this.state === ReordeGroupState.Complete) {
|
||||
if (selectedItemEl && this.state === ReorderGroupState.Complete) {
|
||||
const children = this.el.children as any;
|
||||
const len = children.length;
|
||||
const toIndex = this.lastToIndex;
|
||||
@ -237,7 +237,7 @@ export class ReorderGroup implements ComponentInterface {
|
||||
selectedItemEl.style.transition = '';
|
||||
selectedItemEl.classList.remove(ITEM_REORDER_SELECTED);
|
||||
this.selectedItemEl = undefined;
|
||||
this.state = ReordeGroupState.Idle;
|
||||
this.state = ReorderGroupState.Idle;
|
||||
}
|
||||
return listOrReorder;
|
||||
}
|
||||
@ -294,7 +294,7 @@ export class ReorderGroup implements ComponentInterface {
|
||||
return {
|
||||
class: {
|
||||
'reorder-enabled': !this.disabled,
|
||||
'reorder-list-active': this.state !== ReordeGroupState.Idle,
|
||||
'reorder-list-active': this.state !== ReorderGroupState.Idle,
|
||||
}
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user