mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-04-14 00:40:25 +00:00
blur buttons on drag and mouse out
This commit is contained in:
parent
4db8fabe3d
commit
db8837cb49
1 changed files with 22 additions and 0 deletions
|
|
@ -17,6 +17,26 @@ class Button extends PureComponent {
|
|||
if (event.which === 13) { // Enter key code
|
||||
this.onClick(event);
|
||||
}
|
||||
|
||||
if (typeof this.props.onKeyUp === 'function') {
|
||||
this.props.onKeyUp(event);
|
||||
}
|
||||
}
|
||||
|
||||
onDrag = (event) => {
|
||||
event.currentTarget.blur();
|
||||
|
||||
if (typeof this.props.onDrag === 'function') {
|
||||
this.props.onDrag(event);
|
||||
}
|
||||
}
|
||||
|
||||
onMouseOut = (event) => {
|
||||
event.currentTarget.blur();
|
||||
|
||||
if (typeof this.props.onMouseOut === 'function') {
|
||||
this.props.onMouseOut(event);
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
|
|
@ -28,6 +48,8 @@ class Button extends PureComponent {
|
|||
tabIndex={focusable ? 0 : -1}
|
||||
onClick={this.onClick}
|
||||
onKeyUp={this.onKeyUp}
|
||||
onDrag={this.onDrag}
|
||||
onMouseOut={this.onMouseOut}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue