diff --git a/core/src/components/item-sliding/item-sliding.tsx b/core/src/components/item-sliding/item-sliding.tsx index ec605429b5..a250b5e9bf 100644 --- a/core/src/components/item-sliding/item-sliding.tsx +++ b/core/src/components/item-sliding/item-sliding.tsx @@ -76,12 +76,19 @@ export class ItemSliding implements ComponentInterface { this.item = el.querySelector('ion-item'); this.contentEl = findClosestIonContent(el); - await this.updateOptions(); - + /** + * The MutationObserver needs to be added before we + * call updateOptions below otherwise we may miss + * ion-item-option elements that are added to the DOM + * while updateOptions is running and before the MutationObserver + * has been initialized. + */ this.mutationObserver = watchForOptions(el, 'ion-item-option', async () => { await this.updateOptions(); }); + await this.updateOptions(); + this.gesture = (await import('../../utils/gesture')).createGesture({ el, gestureName: 'item-swipe',