Skip to content

Commit 1cf5904

Browse files
committed
fix(sheet): improving performance more by only running DOM query logic when expandToScroll is diabled
1 parent 28d4b2a commit 1cf5904

File tree

1 file changed

+5
-3
lines changed
  • core/src/components/modal/gestures

1 file changed

+5
-3
lines changed

core/src/components/modal/gestures/sheet.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,9 +239,11 @@ export const createSheetGesture = (
239239
* this allows us to avoid querying the DOM for the target in onMove,
240240
* which would impact performance significantly.
241241
*/
242-
const targetEl = findClosestIonContent(detail.event.target! as HTMLElement);
243-
cachedScrollEl =
244-
targetEl && isIonContent(targetEl) ? getElementRoot(targetEl).querySelector('.inner-scroll') : targetEl;
242+
if (!expandToScroll) {
243+
const targetEl = findClosestIonContent(detail.event.target! as HTMLElement);
244+
cachedScrollEl =
245+
targetEl && isIonContent(targetEl) ? getElementRoot(targetEl).querySelector('.inner-scroll') : targetEl;
246+
}
245247

246248
/**
247249
* If expandToScroll is disabled, we need to swap

0 commit comments

Comments
 (0)