react-native-navigation icon indicating copy to clipboard operation
react-native-navigation copied to clipboard

[Android] Hide keyboard when view is destroyed

Open fiznool opened this issue 4 years ago • 6 comments

Fixes #7008

All credit here must go to @enahum, I am merely packing the changes into a PR.

fiznool avatar Oct 06 '21 11:10 fiznool

Perhaps we could add an option to control if the Keyboard should dismiss or not, as I mentioned in the issue #7008 this was causing other unforeseen issues, so by adding an option that defaults to true and respecting that option we could then hide the keyboard or leave it opened.

enahum avatar Oct 06 '21 12:10 enahum

Btw thanks for submitting a PR ;)

enahum avatar Oct 06 '21 12:10 enahum

I will bow to superior knowledge here! The original patch is working well for us but I can see how it isn't a silver bullet. Perhaps this PR should be closed in favour of another?

FWIW I like the blurOnUnmount option, this is already present in the options but doesn't seem to be respected in this use case, so using that seems to be a good course of action.

fiznool avatar Oct 06 '21 12:10 fiznool

We already making checks in our playground. and maybe adding e2e's for such cases. I already debugged that internally with our devs and found out about why Keyboard.dismiss did not work, and made it work, gonna try to see what was that, but mainly we want to reproduce the issue in our playground and introduce a proper solution if Keyboard dismiss should be handled in our side

swabbass avatar Oct 06 '21 17:10 swabbass

If it helps, we saw the issue when using Navigation.setRoot to move from a single screen (inside a stack) to a stack with a sideMenu. In this case, if the keyboard was showing when the call is made, it does not dismiss.

fiznool avatar Oct 06 '21 20:10 fiznool

I tried to reproduce the issue without the changes mentioned here, but could not reproduce it see.

Let's first reproduce the issue in a minimal environment as the guidelines state and see what is the problem itself and then we might push a fix.

swabbass avatar Oct 26 '21 12:10 swabbass