Skip to content

Commit 4fe25d9

Browse files
authored
chore: Improve docs on positionables (#9781)
* chore: Improve docs on positionables * fix: Fix docs
1 parent b24f23f commit 4fe25d9

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

  • packages/docs/docs/guides/configure/web

packages/docs/docs/guides/configure/web/focus.mdx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,4 +370,14 @@ implement
370370
[`IPositionable`](/reference/blockly.ipositionable).
371371
Examples are the trashcan and the backpack in the [backpack
372372
plugin](https://www.npmjs.com/package/@blockly/workspace-backpack).
373-
Positionables are not yet integrated into the focus system.
373+
Built-in positionables are integrated with the focus system, but if you create
374+
your own you should ensure that they work well with it. The built-in ones follow
375+
this pattern:
376+
377+
* Implement `IFocusableNode`
378+
* Ensure that the focusable DOM element (the one returned from
379+
`getFocusableElement()`) has `tabindex="0"`
380+
381+
Depending on the purpose of your positionable, you should also consider
382+
registering a keyboard shortcut to perform its action (e.g. zoom in) or to
383+
directly focus it (e.g. a workspace search field).

0 commit comments

Comments
 (0)