File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -724,11 +724,13 @@ header.addEventListener('mouseenter', (e) => {
724724notebook_hide_icon . addEventListener ( 'click' , ( e ) => {
725725 // We find the x coordinate of the pluto-notebook element, to avoid missing the cell when UI is disabled
726726 const { x } = document . querySelector ( 'pluto-notebook' ) . getBoundingClientRect ( )
727- const ref = document . elementFromPoint ( x + 1 , 100 ) . closest ( 'pluto-cell' )
728- const { y } = ref . getBoundingClientRect ( )
727+ const ref = document . elementFromPoint ( x + 1 , 100 ) ? .closest ( 'pluto-cell' )
728+ const y = ref ? .getBoundingClientRect ( ) . y
729729 toggle_notebook_attribute ( 'hide-enabled' )
730- const dy = ref . getBoundingClientRect ( ) . y - y
731- window . scrollBy ( 0 , dy )
730+ if ( ref != null && y != null ) {
731+ const dy = ref . getBoundingClientRect ( ) . y - y
732+ window . scrollBy ( 0 , dy )
733+ }
732734} )
733735
734736// Save to file functionality
You can’t perform that action at this time.
0 commit comments