@@ -21,12 +21,9 @@ import * as eventUtils from './events/utils.js';
2121import { FlyoutItem } from './flyout_item.js' ;
2222import { FlyoutMetricsManager } from './flyout_metrics_manager.js' ;
2323import { FlyoutSeparator , SeparatorAxis } from './flyout_separator.js' ;
24- import { getFocusManager } from './focus_manager.js' ;
2524import { IAutoHideable } from './interfaces/i_autohideable.js' ;
2625import type { IFlyout } from './interfaces/i_flyout.js' ;
2726import type { IFlyoutInflater } from './interfaces/i_flyout_inflater.js' ;
28- import { IFocusableNode } from './interfaces/i_focusable_node.js' ;
29- import { IFocusableTree } from './interfaces/i_focusable_tree.js' ;
3027import type { Options } from './options.js' ;
3128import * as registry from './registry.js' ;
3229import * as renderManagement from './render_management.js' ;
@@ -46,7 +43,7 @@ import {WorkspaceSvg} from './workspace_svg.js';
4643 */
4744export abstract class Flyout
4845 extends DeleteArea
49- implements IAutoHideable , IFlyout , IFocusableNode
46+ implements IAutoHideable , IFlyout
5047{
5148 /**
5249 * Position the flyout.
@@ -306,7 +303,6 @@ export abstract class Flyout
306303 // hide/show code will set up proper visibility and size later.
307304 this . svgGroup_ = dom . createSvgElement ( tagName , {
308305 'class' : 'blocklyFlyout' ,
309- 'tabindex' : '0' ,
310306 } ) ;
311307 this . svgGroup_ . style . display = 'none' ;
312308 this . svgBackground_ = dom . createSvgElement (
@@ -321,9 +317,6 @@ export abstract class Flyout
321317 this . workspace_
322318 . getThemeManager ( )
323319 . subscribe ( this . svgBackground_ , 'flyoutOpacity' , 'fill-opacity' ) ;
324-
325- getFocusManager ( ) . registerTree ( this ) ;
326-
327320 return this . svgGroup_ ;
328321 }
329322
@@ -405,7 +398,6 @@ export abstract class Flyout
405398 if ( this . svgGroup_ ) {
406399 dom . removeNode ( this . svgGroup_ ) ;
407400 }
408- getFocusManager ( ) . unregisterTree ( this ) ;
409401 }
410402
411403 /**
@@ -969,63 +961,4 @@ export abstract class Flyout
969961
970962 return null ;
971963 }
972-
973- /** See IFocusableNode.getFocusableElement. */
974- getFocusableElement ( ) : HTMLElement | SVGElement {
975- if ( ! this . svgGroup_ ) throw new Error ( 'Flyout DOM is not yet created.' ) ;
976- return this . svgGroup_ ;
977- }
978-
979- /** See IFocusableNode.getFocusableTree. */
980- getFocusableTree ( ) : IFocusableTree {
981- return this ;
982- }
983-
984- /** See IFocusableNode.onNodeFocus. */
985- onNodeFocus ( ) : void { }
986-
987- /** See IFocusableNode.onNodeBlur. */
988- onNodeBlur ( ) : void { }
989-
990- /** See IFocusableTree.getRootFocusableNode. */
991- getRootFocusableNode ( ) : IFocusableNode {
992- return this ;
993- }
994-
995- /** See IFocusableTree.getRestoredFocusableNode. */
996- getRestoredFocusableNode (
997- _previousNode : IFocusableNode | null ,
998- ) : IFocusableNode | null {
999- return null ;
1000- }
1001-
1002- /** See IFocusableTree.getNestedTrees. */
1003- getNestedTrees ( ) : Array < IFocusableTree > {
1004- return [ this . workspace_ ] ;
1005- }
1006-
1007- /** See IFocusableTree.lookUpFocusableNode. */
1008- lookUpFocusableNode ( _id : string ) : IFocusableNode | null {
1009- // No focusable node needs to be returned since the flyout's subtree is a
1010- // workspace that will manage its own focusable state.
1011- return null ;
1012- }
1013-
1014- /** See IFocusableTree.onTreeFocus. */
1015- onTreeFocus (
1016- _node : IFocusableNode ,
1017- _previousTree : IFocusableTree | null ,
1018- ) : void { }
1019-
1020- /** See IFocusableTree.onTreeBlur. */
1021- onTreeBlur ( nextTree : IFocusableTree | null ) : void {
1022- const toolbox = this . targetWorkspace . getToolbox ( ) ;
1023- // If focus is moving to either the toolbox or the flyout's workspace, do
1024- // not close the flyout. For anything else, do close it since the flyout is
1025- // no longer focused.
1026- if ( toolbox && nextTree === toolbox ) return ;
1027- if ( nextTree == this . workspace_ ) return ;
1028- if ( toolbox ) toolbox . clearSelection ( ) ;
1029- this . autoHide ( false ) ;
1030- }
1031964}
0 commit comments