e.target.href does not work in firefox. This only works in chrome. I tried following question's solution (event.target not working on Firefox) but still not working on firefox. Do i have to add something more?
app.js
showModal(e) {
if (!e) {
e = window.event;
}
e.preventDefault();
const event = e.target || e.srcElement;
const url = event.href;
console.log('url', url, event.href);
const redirectTo = url.substring(url.lastIndexOf('/') + 1);
this.setState({ show: true });
this.context.router.transitionTo(redirectTo);
}
<Nav
showModal={(e) => this.showModal(e)}
hideModal={() => this.hideModal()}
show={this.state.show}
onHide={() => this.hideModal()}
/>
Nav.js
<button
className="btn btn-default"
onClick={(e) => props.showModal(e)}
>
<Link to={{ pathname: '/signup' }}>
{props.intl.formatMessage({ id: 'nav.registration.text' }) }
</Link>
</button>