fix(820): move with attributes

pull/5076/head
Bassam Ismail 5 years ago
parent 60b1d96e2d
commit 116013add8

@ -424,6 +424,25 @@ export default class Element extends Node {
}); });
} }
if (name === "onmouseover") {
if (!this.attributes.find(i => i.name === 'onFocus')) {
component.warn(attribute, {
code: `a11y-mouse-events-have-key-events`,
message: `A11y: onMouseOver must be accompanied by onFocus for accessibility.`
});
}
}
if (name === "onmouseout") {
if (!this.attributes.find(i => i.name === 'onBlur')) {
component.warn(attribute, {
code: `a11y-mouse-events-have-key-events`,
message: `A11y: onMouseOut must be accompanied by onBlur for accessibility.`
});
}
}
attribute_map.set(attribute.name, attribute); attribute_map.set(attribute.name, attribute);
}); });
} }
@ -507,24 +526,6 @@ export default class Element extends Node {
} }
} }
if (attribute_map.has('onMouseOver') || attribute_map.has('onMouseOut')) {
if (attribute_map.has('onMouseOver') && !attribute_map.has('onFocus')) {
component.warn(this, {
code: `a11y-mouse-events-have-key-events`,
message: `A11y: onMouseOver must be accompanied by onFocus for accessibility.`
});
}
if (attribute_map.has('onMouseOut') && attribute_map.has('onBlur')) {
component.warn(this, {
code: `a11y-mouse-events-have-key-events`,
message: `A11y: onMouseOut must be accompanied by onBlur for accessibility.`
});
}
}
if (a11y_no_onchange.has(this.name)) { if (a11y_no_onchange.has(this.name)) {
if (handlers_map.has('change') && !handlers_map.has('blur')) { if (handlers_map.has('change') && !handlers_map.has('blur')) {
component.warn(this, { component.warn(this, {

@ -2,31 +2,31 @@
{ {
"code": "a11y-mouse-events-have-key-events", "code": "a11y-mouse-events-have-key-events",
"end": { "end": {
"character": 36, "character": 33,
"column": 36, "column": 33,
"line": 1 "line": 1
}, },
"message": "A11y: onMouseOver must be accompanied by onFocus for accessibility.", "message": "A11y: onMouseOver must be accompanied by onFocus for accessibility.",
"pos": 0, "pos": 5,
"start": { "start": {
"character": 0, "character": 5,
"column": 0, "column": 5,
"line": 1 "line": 1
} }
}, },
{ {
"code": "a11y-mouse-events-have-key-events", "code": "a11y-mouse-events-have-key-events",
"end": { "end": {
"character": 194, "character": 69,
"column": 59, "column": 32,
"line": 4 "line": 2
}, },
"message": "A11y: onMouseOut must be accompanied by onBlur for accessibility.", "message": "A11y: onMouseOut must be accompanied by onBlur for accessibility.",
"pos": 135, "pos": 42,
"start": { "start": {
"character": 135, "character": 42,
"column": 0, "column": 5,
"line": 4 "line": 2
} }
} }
] ]

Loading…
Cancel
Save