-
Notifications
You must be signed in to change notification settings - Fork 24.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hardware back button handling breaks when a component with a text input loses the focus #21316
Comments
I am closing this issue because it does not appear to have been verified on the latest release, and there has been no followup in a while. If you found this thread after encountering the same issue in the latest release, please feel free to create a new issue with up-to-date information by clicking here. |
import React, { Component } from 'react'; class HandleBack extends Component { constructor(props) { componentDidMount() { onBack = () => { componentWillUnmount() { render() { export default withNavigation(HandleBack); // how to use the in component handleBackButton = () => { )} |
i m able to reproduce this issue |
@mbillard did you get any solutions?? |
No, I haven't tried to reproduce the issue recently either. |
Environment
Description
If a component with a text input that had the focus gets blurred, the hardware back button handler no longer gets called when pressing the hardware back button.
With the sample code below:
✅ If I press the back button before the input gets focused, the back button gets handled.
✅ If I give focus to the input and press the back button, it gets handled.
❌ If I give focus to the input, blur it with the button (or any other way), the back button does not get handled
✅ If instead of an input and a button I have two inputs, switching focus between each does not break the back button handling.
Reproducible Demo
This is the smallest component I could setup with which I managed to reproduce the issue. I also tested with a regular
Component
with the same result.The text was updated successfully, but these errors were encountered: