callstack / react-native-paper

Material Design for React Native (Android & iOS)
https://reactnativepaper.com
MIT License
12.79k stars 2.08k forks source link

Opening a Menu from a TextInput anchor on the web unfocuses the anchor #2903

Open pta2002 opened 3 years ago

pta2002 commented 3 years ago

Current behaviour

When a Menu has a TextInput as an anchor, if that input's onFocus is used to open the menu, it becomes unfocused.

Expected behaviour

This is not consistent with Android, where it keeps focus. It would be nice if it worked this way on the web too, so that a searchable dropdown can be implemented.

Code sample

https://snack.expo.dev/@pta2002/eb79e2

What have you tried

I have tried using a separate component (not the anchor) to trigger the menu, but it got unfocused as well. Either way, I think the behaviour should at least be consistent.

Your Environment

software version
ios or android Android 11
react-native 0.63.2
react-native-paper 4.9.2
node 14.17.6
npm or yarn npm 6.14.15
expo sdk 42.0.1
github-actions[bot] commented 3 years ago

Hey! Thanks for opening the issue. The issue doesn't seem to contain a link to a repro (a snack.expo.io link or link to a GitHub repo under your username).

Can you provide a minimal repro which demonstrates the issue? A repro will help us debug the issue faster. Please try to keep the repro as small as possible and make sure that we can run it without additional setup.

github-actions[bot] commented 3 years ago

Couldn't find version numbers for the following packages in the issue:

Can you update the issue to include version numbers for those packages? The version numbers must match the format 1.2.3.

The versions mentioned in the issue for the following packages differ from the latest versions on npm:

Can you verify that the issue still exists after upgrading to the latest versions of these packages?

github-actions[bot] commented 2 years ago

Hello 👋, this issue has been open for more than a month without a repro or any activity. If the issue is still present in the latest version, please provide a repro or leave a comment within 7 days to keep it open, otherwise it will be closed automatically. If you found a solution or workaround for the issue, please comment here for others to find. If this issue is critical for you, please consider sending a pull request to fix it.

pta2002 commented 2 years ago

This is still an issue, and I did provide a repro: https://snack.expo.dev/@pta2002/eb79e2 don't know why it says it doesn't have one

cvburgess commented 2 years ago

I have a similar issue, text inputs fail to focus like the snack demo shows - I need to use the tab key to properly focus the input.

2022-01-19 09 34 37

cvburgess commented 2 years ago

Our issue is unrelated, i tracked it down to the input being wrapped in a <TouchableWithoutFeedback onPress={Keyboard.dismiss}> which works fine on mobile but doesn't work the same on web - not a Paper issue. Sorry!

BadhanGanesh-HappyFox commented 2 years ago

This is still happening. @pta2002 Any luck with a solution / workaround?

pta2002 commented 2 years ago

This is still happening. @pta2002 Any luck with a solution / workaround?

Sorry, gave up shortly after and didn't attempt to find a solution :(