File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,3 +20,8 @@ export interface IAutoHideable extends IComponent {
2020 */
2121 autoHide ( onlyClosePopups : boolean ) : void ;
2222}
23+
24+ /** Returns true if the given object is autohideable. */
25+ export function isAutoHideable ( obj : any ) : obj is IAutoHideable {
26+ return obj . autoHide !== undefined ;
27+ }
Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ import {getFocusManager} from './focus_manager.js';
4141import { Gesture } from './gesture.js' ;
4242import { Grid } from './grid.js' ;
4343import type { IASTNodeLocationSvg } from './interfaces/i_ast_node_location_svg.js' ;
44+ import { isAutoHideable } from './interfaces/i_autohideable.js' ;
4445import type { IBoundedElement } from './interfaces/i_bounded_element.js' ;
4546import { IContextMenu } from './interfaces/i_contextmenu.js' ;
4647import type { IDragTarget } from './interfaces/i_drag_target.js' ;
@@ -2765,7 +2766,7 @@ export class WorkspaceSvg
27652766 if ( flyout && nextTree === flyout ) return ;
27662767 if ( toolbox && nextTree === toolbox ) return ;
27672768 if ( toolbox ) toolbox . clearSelection ( ) ;
2768- if ( flyout && flyout instanceof Flyout ) flyout . autoHide ( false ) ;
2769+ if ( flyout && isAutoHideable ( flyout ) ) flyout . autoHide ( false ) ;
27692770 }
27702771 }
27712772}
You can’t perform that action at this time.
0 commit comments