MCPcopy Index your code
hub / github.com/ionic-team/ionic-framework / disableContentScrollY

Function disableContentScrollY

core/src/utils/content/index.ts:110–129  ·  view source on GitHub ↗
(contentEl: HTMLElement)

Source from the content-addressed store, hash-verified

108 * Use this utility to account for ion-content and custom content hosts.
109 */
110export const disableContentScrollY = (contentEl: HTMLElement): boolean => {
111 if (isIonContent(contentEl)) {
112 const ionContent = contentEl as HTMLIonContentElement;
113 const initialScrollY = ionContent.scrollY;
114 ionContent.scrollY = false;
115
116 /**
117 * This should be passed into resetContentScrollY
118 * so that we can revert ion-content's scrollY to the
119 * correct state. For example, if scrollY = false
120 * initially, we do not want to enable scrolling
121 * when we call resetContentScrollY.
122 */
123 return initialScrollY;
124 } else {
125 contentEl.style.setProperty('overflow', 'hidden');
126
127 return true;
128 }
129};
130
131export const resetContentScrollY = (contentEl: HTMLElement, initialScrollY: boolean) => {
132 if (isIonContent(contentEl)) {

Callers 4

onStartMethod · 0.90
onMoveMethod · 0.90
onStartFunction · 0.90
onMoveFunction · 0.90

Calls 1

isIonContentFunction · 0.85

Tested by

no test coverage detected