(contentEl: HTMLElement)
| 108 | * Use this utility to account for ion-content and custom content hosts. |
| 109 | */ |
| 110 | export 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 | |
| 131 | export const resetContentScrollY = (contentEl: HTMLElement, initialScrollY: boolean) => { |
| 132 | if (isIonContent(contentEl)) { |
no test coverage detected