File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -37,11 +37,11 @@ export function useIonHeaderParallax({
3737 // ion-toolbar background
3838 const toolbarShadowRoot = toolbar . shadowRoot
3939
40- if ( ! toolbarShadowRoot ) throw new Error ( 'No shadow' )
40+ // if (!toolbarShadowRoot) throw new Error('No shadow')
4141
42- const toolbarBackground = toolbarShadowRoot . querySelector ( '.toolbar-background' ) as HTMLElement
42+ const toolbarBackground = toolbarShadowRoot ? .querySelector ( '.toolbar-background' ) as HTMLElement
4343
44- if ( ! toolbarBackground ) throw new Error ( 'No .toolbar-background' )
44+ // if (!toolbarBackground) throw new Error('No .toolbar-background')
4545
4646 // ion-title
4747 const ionTitle = toolbar . querySelector ( 'ion-title' ) as HTMLElement
@@ -98,10 +98,11 @@ export function useIonHeaderParallax({
9898 window . getComputedStyle ( scrollContent as Element , null ) . paddingTop . replace ( 'px' , '' )
9999 )
100100 }
101-
102101 let originalToolbarBgColor = 'white'
103- originalToolbarBgColor = window . getComputedStyle ( toolbarBackground as Element , null ) . backgroundColor
104102
103+ if ( toolbarBackground ) {
104+ originalToolbarBgColor = window . getComputedStyle ( toolbarBackground as Element , null ) . backgroundColor
105+ }
105106
106107 // header and title
107108 header . style . position = 'relative'
You can’t perform that action at this time.
0 commit comments