Skip to content

Commit e109450

Browse files
committed
add doc
1 parent 0460bec commit e109450

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

packages/web-components/src/_docs/developer/polyfilling.mdx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,3 +94,17 @@ if (!CSS.supports('anchor-name: --foo')) {
9494
import { default as applyPolyfill } from '@oddbird/css-anchor-positioning/fn';
9595
window.CSS_ANCHOR_POLYFILL = applyPolyfill;
9696
```
97+
98+
## HTML Focusgroup
99+
100+
For components that require directional navigations (moving focus between focusable elements within a component with arrow keys instead of tab), Fluent Web Components have adopted [HTML Focusgroup](https://open-ui.org/components/scoped-focusgroup.explainer/). The components that currently use focusgroup include MenuList/MenuItem, RadioGroup/Radio, Tablist/Tab, and Tree/TreeItem.
101+
102+
For browsers that don’t yet support focusgroup, we use [`@microsoft/focusgroup-polyfill`](https://github.com/microsoft/polyfills/tree/main/packages/focusgroup) and automatically polyfill the components when they are connected to the DOM.
103+
104+
If you want to opt out of the polyfill, you can use the base classes of these components, e.g.
105+
106+
```js
107+
import { BaseTablist } from '@fluentui/web-components/tablist/base.js';
108+
109+
export class MyTablist extends BaseTablist {}
110+
```

0 commit comments

Comments
 (0)