File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -724,15 +724,15 @@ function Highlighter(options = hhDefaultOptions) {
724724 }
725725
726726 // Window resize
727- let previousWindowWidth = window . innerWidth ;
727+ let previousContainerWidth = this . annotatableContainer . clientWidth ;
728728 const respondToWindowResize = ( ) => {
729- // Only respond if the width changed (ignore height changes)
730- if ( window . innerWidth === previousWindowWidth ) return ;
729+ // Only respond if the annotatable container width changed
730+ if ( this . annotatableContainer . clientWidth === previousContainerWidth ) return ;
731731 if ( options . drawingMode === 'svg' ) {
732732 this . drawHighlights ( ) ;
733733 if ( previousSelectionRange ) updateSelectionUi ( 'bounds' ) ;
734734 }
735- previousWindowWidth = window . innerWidth ;
735+ previousContainerWidth = this . annotatableContainer . clientWidth ;
736736 }
737737 const debouncedRespondToWindowResize = debounce ( ( ) => respondToWindowResize ( ) , Math . floor ( Object . keys ( highlightsById ) . length / 20 ) ) ;
738738 window . addEventListener ( 'resize' , debouncedRespondToWindowResize , { signal : controller . signal } ) ;
You can’t perform that action at this time.
0 commit comments