Skip to content

Commit

Permalink
Feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
m-akinc committed May 21, 2024
1 parent bbb59ea commit 2c6e29c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
19 changes: 13 additions & 6 deletions packages/nimble-components/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -387,14 +387,21 @@ export class MyComponent {

Then in the template, bind the focusable elements' `tabindex` to the host component's property:

<!-- prettier-ignore -->
```html
html<MyComponent
>`
<nimble-button ... tabindex="${x => x.tabIndex}"></nimble-button>
html<MyComponent>`
<nimble-button
...
tabindex="${x => x.tabIndex}">
</nimble-button>
// or for an element that isn't focusable by default:
<div ... tabindex="${x => (x.disabled ? null : x.tabIndex ?? 0)}"></div>
`;</MyComponent
>
<div
...
tabindex="${x => {
const tabindex = x.tabIndex ?? 0;
return x.disabled ? undefined : `${tabindex}`;
}">
</div>`;
```

### Leverage mixins for shared APIs across components
Expand Down
2 changes: 1 addition & 1 deletion packages/nimble-components/src/toggle-button/template.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable no-restricted-syntax */
import { html, ref, ViewTemplate } from '@microsoft/fast-element';
import {
endSlotTemplate,
Expand Down Expand Up @@ -65,3 +64,4 @@ ButtonOptions
${endSlotTemplate(context, definition)}
</div>
`;
/* eslint-enable @typescript-eslint/indent */

0 comments on commit 2c6e29c

Please sign in to comment.