onClick
with some elements JS-0746 9 return (
10 <div data-test="tag-list" key={index} className="tag-sel-item">
11 {item.label}
12 <span13 data-test="tag-delete"14 className="tag-close-btn"15 onClick={(e) => { handleTagRemove(item.value); }}16 ></span>17 </div>
18 );
19 });
Enforce onClick
is accompanied by at least one of the following: onKeyUp
, onKeyDown
, onKeyPress
. Coding for the keyboard is important for users with physical disabilities who cannot use a mouse, AT compatibility, and screenreader users. This does not apply for interactive or hidden elements
<div onClick={() => {}} />
<div onClick={() => {}} onKeyDown={this.handleKeyDown} />
<div onClick={() => {}} onKeyUp={this.handleKeyUp} />
<div onClick={() => {}} onKeyPress={this.handleKeyPress} />
<button onClick={() => {}} />
<div onClick{() => {}} aria-hidden="true" />