Skip to content

Commit

Permalink
[Docs] no-static-element-interactions: Update error message
Browse files Browse the repository at this point in the history
- Recommend using native HTML whenever possible
- If using native counterpart is impossible, recommend adding to all
interactive non-semantic elements an appropriate role along with
support for mouse, keyboard and touch inputs.

Fixes #761
  • Loading branch information
uncommon-type authored and ljharb committed Mar 16, 2022
1 parent 5e966e5 commit 0f1615a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion __tests__/src/rules/no-static-element-interactions-test.js
Expand Up @@ -19,7 +19,7 @@ import ruleOptionsMapperFactory from '../../__util__/ruleOptionsMapperFactory';

const ruleTester = new RuleTester();

const errorMessage = 'Static HTML elements with event handlers require a role.';
const errorMessage = 'Avoid non-native interactive elements. If using native HTML is not possible, add an appropriate role and support for tabbing, mouse, keyboard, and touch inputs to an interactive content element.';

const expectedError = {
message: errorMessage,
Expand Down
2 changes: 1 addition & 1 deletion src/rules/no-static-element-interactions.js
Expand Up @@ -29,7 +29,7 @@ import isNonInteractiveRole from '../util/isNonInteractiveRole';
import isNonLiteralProperty from '../util/isNonLiteralProperty';
import isPresentationRole from '../util/isPresentationRole';

const errorMessage = 'Static HTML elements with event handlers require a role.';
const errorMessage = 'Avoid non-native interactive elements. If using native HTML is not possible, add an appropriate role and support for tabbing, mouse, keyboard, and touch inputs to an interactive content element.';

const domElements = [...dom.keys()];
const defaultInteractiveProps = [
Expand Down

0 comments on commit 0f1615a

Please sign in to comment.