Skip to content

Commit 8f26215

Browse files
committed
add logs
1 parent 60cc8a6 commit 8f26215

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/useIonicHeaderParallax.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export function useIonHeaderParallax({
2121
React.useEffect(() => {
2222
setTimeout(() => {
2323
initElements()
24-
}, 200)
24+
}, 500)
2525
}, [titleColor, image, expandedColor, maximumHeight])
2626

2727
const initElements = () => {
@@ -36,10 +36,13 @@ export function useIonHeaderParallax({
3636

3737
// ion-toolbar background
3838
const toolbarShadowRoot = toolbar.shadowRoot
39+
40+
console.log(toolbarShadowRoot)
3941
if (!toolbarShadowRoot) throw new Error('No shadow')
4042
const toolbarBackground = toolbarShadowRoot.querySelector('.toolbar-background') as HTMLElement
4143

42-
if (!toolbarBackground) throw new Error('No .toolbar-background')
44+
console.log(toolbarBackground)
45+
4346

4447
// ion-title
4548
const ionTitle = toolbar.querySelector('ion-title')
@@ -92,10 +95,10 @@ export function useIonHeaderParallax({
9295
let headerMinHeight = toolbar.offsetHeight
9396

9497
let scrollContentPaddingTop: number = parseFloat(
95-
window.getComputedStyle(scrollContent, null).paddingTop.replace('px', '')
98+
window.getComputedStyle(scrollContent as Element, null).paddingTop.replace('px', '')
9699
)
97100

98-
const originalToolbarBgColor = window.getComputedStyle(toolbarBackground, null).backgroundColor
101+
const originalToolbarBgColor = window.getComputedStyle(toolbarBackground as Element, null).backgroundColor
99102
if (!originalToolbarBgColor) {
100103
throw new Error('Error: toolbarBackround is null.')
101104
}

0 commit comments

Comments
 (0)