Skip to content

Commit 0f1615a

Browse files
uncommon-typeljharb
authored andcommittedMar 16, 2022
[Docs] no-static-element-interactions: Update error message
- 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
1 parent 5e966e5 commit 0f1615a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed
 

‎__tests__/src/rules/no-static-element-interactions-test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import ruleOptionsMapperFactory from '../../__util__/ruleOptionsMapperFactory';
1919

2020
const ruleTester = new RuleTester();
2121

22-
const errorMessage = 'Static HTML elements with event handlers require a role.';
22+
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.';
2323

2424
const expectedError = {
2525
message: errorMessage,

‎src/rules/no-static-element-interactions.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import isNonInteractiveRole from '../util/isNonInteractiveRole';
2929
import isNonLiteralProperty from '../util/isNonLiteralProperty';
3030
import isPresentationRole from '../util/isPresentationRole';
3131

32-
const errorMessage = 'Static HTML elements with event handlers require a role.';
32+
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.';
3333

3434
const domElements = [...dom.keys()];
3535
const defaultInteractiveProps = [

0 commit comments

Comments
 (0)
Please sign in to comment.