Skip to content

Fix the two template-lint errors (ModeSwitch tabindex, Smart::Feedback keyboard access) - #741

Closed
phndiaye wants to merge 2 commits into
masterfrom
pn/fix-template-lint-errors
Closed

phndiaye wants to merge 2 commits into
masterfrom
pn/fix-template-lint-errors

Conversation

@phndiaye

Copy link
Copy Markdown
Member

What does this PR do?

Fixes the two ember-template-lint errors on master. Master's CI only runs lint:js, so they went unnoticed, but they fail lint:hbs and therefore the "Lint & Typecheck" job of #719, which runs the full pnpm lint.

  • OSS::ModeSwitch (no-positive-tabindex, from 87bd9d4): the rule only accepts literal tabindex values, so the label now uses tabindex={{if @disabled "-1" "0"}} instead of the optionLabelTabIndex getter. Same values as before.
  • OSS::Smart::Feedback (no-invalid-interactive, from 738e330): when the content is truncated, the root element gets role="button" but could not be focused or toggled from the keyboard. It now also gets tabindex="0" and toggles on Enter and Space. Short or non-collapsible feedback is unchanged.

What are the observable changes?

  • A truncated Smart feedback can be reached with Tab and expanded or collapsed with Enter or Space.
  • No visual or mouse behaviour change; the mode switch is unchanged.

Good PR checklist

  • Title makes sense
  • Is against the correct branch
  • Only addresses one issue
  • Properly assigned
  • Added/updated tests
  • Added/updated documentation with Figma design link. Don't forget to replace "design" by "file" in the URL. For example https://www.figma.com/file/example
  • Migrated touched components to Glimmer Components
  • Properly labeled

…k it

no-positive-tabindex only accepts literal values (or if/unless with literal
branches), so `tabindex={{this.optionLabelTabIndex}}` failed lint:hbs. Same
values as before: -1 when disabled, 0 otherwise.
…board operable

When the content is truncated the root element gets role="button", but it
could not be focused or toggled from the keyboard, which is what
no-invalid-interactive reported. It now also gets tabindex="0" and toggles on
Enter and Space. Short or non-collapsible feedback is unchanged: no role, no
tabindex, keys are ignored.
@phndiaye

Copy link
Copy Markdown
Member Author

Moved into #719 (commits 8dbead1 and cf2f118), the PR whose CI runs template-lint.

@phndiaye phndiaye closed this Nov 11, 2026
@phndiaye
phndiaye deleted the pn/fix-template-lint-errors branch November 11, 2026 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant