Improve Accessibility of the new Emoji picker
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
3ee43dc2eb
commit
2e6899be93
2 changed files with 21 additions and 3 deletions
|
@ -114,6 +114,15 @@ limitations under the License.
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.mx_EmojiPicker_search_icon {
|
||||||
|
width: 16px;
|
||||||
|
margin: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mx_EmojiPicker_search_icon:not(.mx_EmojiPicker_search_clear) {
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
.mx_EmojiPicker_search_icon::after {
|
.mx_EmojiPicker_search_icon::after {
|
||||||
mask: url('$(res)/img/emojipicker/search.svg') no-repeat;
|
mask: url('$(res)/img/emojipicker/search.svg') no-repeat;
|
||||||
mask-size: 100%;
|
mask-size: 100%;
|
||||||
|
|
|
@ -35,13 +35,22 @@ class Search extends React.PureComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
let rightButton;
|
||||||
|
if (this.props.query) {
|
||||||
|
rightButton = (
|
||||||
|
<button onClick={() => this.props.onChange("")}
|
||||||
|
className="mx_EmojiPicker_search_icon mx_EmojiPicker_search_clear"
|
||||||
|
title={_t("Cancel search")} />
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
rightButton = <span className="mx_EmojiPicker_search_icon" />;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="mx_EmojiPicker_search">
|
<div className="mx_EmojiPicker_search">
|
||||||
<input autoFocus type="text" placeholder="Search" value={this.props.query}
|
<input autoFocus type="text" placeholder="Search" value={this.props.query}
|
||||||
onChange={ev => this.props.onChange(ev.target.value)} ref={this.inputRef} />
|
onChange={ev => this.props.onChange(ev.target.value)} ref={this.inputRef} />
|
||||||
<button onClick={() => this.props.onChange("")}
|
{rightButton}
|
||||||
className={`mx_EmojiPicker_search_icon ${this.props.query ? "mx_EmojiPicker_search_clear" : ""}`}
|
|
||||||
title={this.props.query ? _t("Cancel search") : _t("Search")} />
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue