mirror of
https://github.com/google/blockly.git
synced 2026-01-07 09:00:11 +01:00
refactor: Make INavigable extend IFocusableNode. (#9033)
This commit is contained in:
@@ -4,24 +4,12 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import type {IFocusableNode} from './i_focusable_node.js';
|
||||
|
||||
/**
|
||||
* Represents a UI element which can be navigated to using the keyboard.
|
||||
*/
|
||||
export interface INavigable<T> {
|
||||
/**
|
||||
* Returns whether or not this specific instance should be reachable via
|
||||
* keyboard navigation.
|
||||
*
|
||||
* Implementors should generally return true, unless there are circumstances
|
||||
* under which this item should be skipped while using keyboard navigation.
|
||||
* Common examples might include being disabled, invalid, readonly, or purely
|
||||
* a visual decoration. For example, while Fields are navigable, non-editable
|
||||
* fields return false, since they cannot be interacted with when focused.
|
||||
*
|
||||
* @returns True if this element should be included in keyboard navigation.
|
||||
*/
|
||||
isNavigable(): boolean;
|
||||
|
||||
export interface INavigable<T> extends IFocusableNode {
|
||||
/**
|
||||
* Returns the class of this instance.
|
||||
*
|
||||
|
||||
@@ -43,4 +43,18 @@ export interface INavigationPolicy<T> {
|
||||
* there is none.
|
||||
*/
|
||||
getPreviousSibling(current: T): INavigable<any> | null;
|
||||
|
||||
/**
|
||||
* Returns whether or not the given instance should be reachable via keyboard
|
||||
* navigation.
|
||||
*
|
||||
* Implementors should generally return true, unless there are circumstances
|
||||
* under which this item should be skipped while using keyboard navigation.
|
||||
* Common examples might include being disabled, invalid, readonly, or purely
|
||||
* a visual decoration. For example, while Fields are navigable, non-editable
|
||||
* fields return false, since they cannot be interacted with when focused.
|
||||
*
|
||||
* @returns True if this element should be included in keyboard navigation.
|
||||
*/
|
||||
isNavigable(current: T): boolean;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user