mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
fix(reorder-group): wait for content to render before getting scroll position (#24007)
resolves #23875
This commit is contained in:
@@ -2,6 +2,7 @@ import { Component, ComponentInterface, Element, Event, EventEmitter, Host, Meth
|
||||
|
||||
import { getIonMode } from '../../global/ionic-global';
|
||||
import { Gesture, GestureDetail, ItemReorderEventDetail } from '../../interface';
|
||||
import { componentOnReady } from '../../utils/helpers';
|
||||
import { hapticSelectionChanged, hapticSelectionEnd, hapticSelectionStart } from '../../utils/native/haptic';
|
||||
|
||||
const enum ReorderGroupState {
|
||||
@@ -55,6 +56,7 @@ export class ReorderGroup implements ComponentInterface {
|
||||
async connectedCallback() {
|
||||
const contentEl = this.el.closest('ion-content');
|
||||
if (contentEl) {
|
||||
await new Promise(resolve => componentOnReady(contentEl, resolve));
|
||||
this.scrollEl = await contentEl.getScrollElement();
|
||||
}
|
||||
this.gesture = (await import('../../utils/gesture')).createGesture({
|
||||
|
||||
Reference in New Issue
Block a user