When I click on a pagination button, the focus state stays in the browser after the page updates. How to I tell that component to blur?
This is where I'm calling the component.
<Paginate onClick={this.handleButtonClick.bind(this)} text="Prev"/>
This is the component.
import React, { Component } from 'react';
class Paginate extends Component {
render() {
const {text} = this.props;
return(
<button onClick={this.props.onClick}>{text}</button>
)
}
}
export default Paginate;
Adding to mrossman's comment in the accepted answer, what worked for me was onClick={(e) => e.currentTarget.blur()}.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With