Skip to content

Commit 4ffa5f6

Browse files
committed
fix(modal): add footer check
1 parent e15ae91 commit 4ffa5f6

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,12 @@ export const createSheetGesture = (
122122
* @param footer - The footer to show
123123
*/
124124
const swapFooterVisibility = (footer: 'original' | 'cloned') => {
125-
const originalFooter = baseEl.querySelector('ion-footer') as HTMLIonFooterElement;
125+
const originalFooter = baseEl.querySelector('ion-footer') as HTMLIonFooterElement | null;
126+
127+
if (!originalFooter) {
128+
return;
129+
}
130+
126131
const clonedFooter = wrapperEl.nextElementSibling as HTMLIonFooterElement;
127132
const footerToHide = footer === 'original' ? clonedFooter : originalFooter;
128133
const footerToShow = footer === 'original' ? originalFooter : clonedFooter;

core/src/components/modal/modal.tsx

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -131,15 +131,14 @@ export class Modal implements ComponentInterface, OverlayInterface {
131131
@Prop() breakpoints?: number[];
132132

133133
/**
134-
* Determines whether or not the sheet modal will only
135-
* scroll/drag the content when fully expanded. This
136-
* will only take effect when the `breakpoints` and
137-
* `initialBreakpoint` properties are set.
134+
* Controls whether scrolling or dragging within the sheet modal expands
135+
* it to a larger breakpoint. This only takes effect when `breakpoints`
136+
* and `initialBreakpoint` are set.
138137
*
139-
* If the value is `true`, the modal will only scroll
140-
* when fully expanded.
141-
* If the value is `false`, the modal will scroll at
142-
* any breakpoint.
138+
* If `true`, scrolling or dragging anywhere in the modal will first expand
139+
* it to the next breakpoint. Once fully expanded, scrolling will affect the content.
140+
* If `false`, scrolling will always affect the content, and the modal will only expand
141+
* when dragging the header or handle.
143142
*/
144143
@Prop() expandToScroll = true;
145144

0 commit comments

Comments
 (0)