File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
src/SIL.XForge.Scripture/ClientApp/src/app/translate/editor/lynx/insights Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -88,11 +88,11 @@ export class LynxInsightOverlayService {
88
88
}
89
89
} ) ;
90
90
91
- // When initially displayed, scroll editor if necessary to ensure overlay is displayed within editor bounds
92
- setTimeout ( ( ) => this . ensureOverlayWithinEditorBounds ( overlayRef . ref ) ) ;
93
-
94
91
this . openRef = overlayRef ;
95
92
93
+ // When initially displayed, scroll editor if necessary to ensure overlay is displayed within editor bounds
94
+ setTimeout ( ( ) => this . ensureOverlayWithinEditorBounds ( ) ) ;
95
+
96
96
return overlayRef ;
97
97
}
98
98
@@ -174,8 +174,10 @@ export class LynxInsightOverlayService {
174
174
/**
175
175
* Ensures the overlay is fully within the editor bounds.
176
176
*/
177
- private ensureOverlayWithinEditorBounds ( overlayRef : OverlayRef ) : void {
178
- if ( this . scrollableContainer == null ) {
177
+ private ensureOverlayWithinEditorBounds ( ) : void {
178
+ const overlayRef : OverlayRef | undefined = this . openRef ?. ref ;
179
+
180
+ if ( this . scrollableContainer == null || overlayRef ?. overlayElement == null ) {
179
181
return ;
180
182
}
181
183
You can’t perform that action at this time.
0 commit comments