mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 04:14:21 +08:00
fix(item-sliding): make sure options are ready
This commit is contained in:
@ -37,10 +37,6 @@ ion-item-options {
|
||||
|
||||
user-select: none;
|
||||
z-index: $z-index-item-options;
|
||||
|
||||
&.hydrated {
|
||||
visibility: hidden;
|
||||
}
|
||||
}
|
||||
|
||||
.item-options-start {
|
||||
|
@ -67,7 +67,7 @@ export class ItemSliding {
|
||||
async componentDidLoad() {
|
||||
this.item = this.el.querySelector('ion-item');
|
||||
|
||||
this.updateOptions();
|
||||
await this.updateOptions();
|
||||
|
||||
this.gesture = (await import('../../utils/gesture/gesture')).createGesture({
|
||||
el: this.el,
|
||||
@ -139,7 +139,7 @@ export class ItemSliding {
|
||||
return false;
|
||||
}
|
||||
|
||||
private updateOptions() {
|
||||
private async updateOptions() {
|
||||
const options = this.el.querySelectorAll('ion-item-options');
|
||||
|
||||
let sides = 0;
|
||||
@ -148,14 +148,14 @@ export class ItemSliding {
|
||||
this.leftOptions = this.rightOptions = undefined;
|
||||
|
||||
for (let i = 0; i < options.length; i++) {
|
||||
const option = options.item(i);
|
||||
const option = await options.item(i).componentOnReady();
|
||||
|
||||
if (option.side === 'end') {
|
||||
this.rightOptions = option;
|
||||
sides |= ItemSide.End;
|
||||
} else {
|
||||
if (option.side === 'start') {
|
||||
this.leftOptions = option;
|
||||
sides |= ItemSide.Start;
|
||||
} else {
|
||||
this.rightOptions = option;
|
||||
sides |= ItemSide.End;
|
||||
}
|
||||
}
|
||||
this.optsDirty = true;
|
||||
|
Reference in New Issue
Block a user