blockly > FocusableTreeTraverser > findFocusedNode
FocusableTreeTraverser.findFocusedNode() 方法
返回当前的 IFocusableNode,其样式(因此表示)为具有被动或主动焦点,仅考虑 HTML 和 SVG 元素。
这可以与树的根进行匹配。
请注意,这永远不会返回嵌套子树中的节点,因为该树应专门用于检索其聚焦节点。
Signature:
static findFocusedNode(tree: IFocusableTree): IFocusableNode | null;
参数
参数 | 类型 | 说明 |
---|---|---|
树 | IFocusableTree | 用于搜索聚焦节点的 IFocusableTree。 |
返回:
IFocusableNode | null
当前具有焦点的 IFocusableNode;如果没有,则返回 null。