-
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
[RN 0.59.1] Android picker is always shown as dropdown #24055
Comments
I see this is happening in
If you try to switch for RNTester to use the alpha though:
It works again. So I am hoping we can fix this just switching to |
Hi @ferrannp, Thanks a lot for your response, could you tell me how we can fix this on the current 0.59.1 version? Thanks in advance. |
This comment has been minimized.
This comment has been minimized.
@xAlexV -- we'll need to wait for the release of |
@turnrye thanks for the update. I'll check with the team and hope that a downgrade is not required :D. |
Any update on this issue? |
As stated by @ferranp and @turnrye the issue is related to a bug in the used androidx.appcompat version and should be solved by updating the reference to 1.10 once its final gets released. https://developer.android.com/jetpack/androidx/releases/appcompat shows another alpha (4) got out last week. Guess we just have to wait untill it comes out. |
Would it be worthwhile to revert Picker from extending AppCompatSpinner until dependency with fix is available, if it solves this issue? Then it could be backported to 0.59.x releases. |
CC @dulmandakh. What do you think? |
What is the current status of this bug? |
Any workaround ? |
I've been following this one as I really wanted that modal picker for an app I started with 0.59 as well. Seems like the comment above pretty much says what the RN team is thinking, they're waiting for Appcompat version 1.1.0 to drop a stable release before updating RN to use that version, which should solve this issue. You can keep checking here for progress on that: https://developer.android.com/jetpack/androidx/releases/appcompat Other than that, I don't think you have any options other than using an older version of RN (pre-hooks 😢 ) or writing a custom native plugin. I ended up writing a native plugin because I really wanted this feature and was approaching a deadline. It was pretty straightforward, but may be more challenging if you don't have any experience working on the native side of RN. I'm no expert and I'm not sure how much this will help you, but here's the relevant code for the native module I wrote. Follow the Native Modules guide in the docs for the initial native module setup on Android. Here's the code for the native method you want to expose:
Again, this is probably not the best way to do this, but you can then call this from the JS side like |
@thorsonmscott Thanks |
any new updates/workarounds on this? |
Any new workarounds / fixes on this issue? |
Nothing here? |
any updates about this issue? i can't downgrade my react version because of 64 bit support . |
any one was able to resolve this bug? |
Bug still ocurring |
+1 |
+1 Need a workaround for this. My designer wants picker as it looks at 0.58.6. |
Any workaround on this issue? |
Notthing here ? |
To everybody having problems with this, have you tried using https://github.com/react-native-community/react-native-picker ? |
I cannot install @react-native-community/picker via npm or yarn. "Not found" error occurs. |
This issue with npm appears to be resolved now: react-native-picker/picker#9 I'm personally running into errors for "Tried to register two views with the same name AndroidDropdownPicker" which I'm guessing is due to something else using the native-base version as a dependency. Others may want to give the react-native-community version a try and see if it resolves this issue for them. |
For me https://github.com/react-native-community/react-native-picker works just the same - only dropdown is shown despite the selected dialog mode. |
Tried out the @react-native-community/picker package as suggested above on RN v59.1. Still showing Picker as dropdown only, even when |
As a temporary workaround I've created a native-module as @thorsonmscott suggested. I'm also quite new to native modules, but it was interesting to try it out. Not sure if it will help anyone here (my use case was pretty simple), but I published it as a package to npm. You can find the repo here. |
Any update on this issue? |
janczizikow's workaround works great! Thank you. |
any update? |
Any expected date about when this will be fixed? |
@janczizikow thanks bro, it worked |
According to https://developer.android.com/jetpack/androidx/releases/appcompat the 1.1.0 stable released today. Is there any idea of a timeframe for RN to update accordingly? |
I would be happy to review a PR that would upgrade appcompat version |
@janczizikow thanks for your help. but how can i change styles and cancel text |
any new updates/workarounds on this? |
i found this work around an it works for me in [RN > 0.60] in
if there is no 'styles.xml' file then create your own 'styles.xml' and put the code below :
|
I had this same issue... so when can react-native solve this solution, if this bug is solve here lol |
@iYahya worked for me ! Thanks. |
Is there any update on this issue? |
Picker has been removed from react-native. |
Summary: This sync includes the following changes: - **[3f8990898](facebook/react@3f8990898 )**: Fix test-build-devtools if build was generated by build-for-devtools ([#24088](facebook/react#24088)) //<Sebastian Silbermann>// - **[577f2de46](facebook/react@577f2de46 )**: enableCacheElement flag ([#24131](facebook/react#24131)) //<David McCabe>// - **[2e0d86d22](facebook/react@2e0d86d22 )**: Allow updating dehydrated root at lower priority without forcing client render ([#24082](facebook/react#24082)) //<Andrew Clark>// - **[dbe9e732a](facebook/react@dbe9e732a )**: Avoid conditions where control flow is sufficient ([#24126](facebook/react#24126)) //<Sebastian Markbåge>// - **[b075f9742](facebook/react@b075f9742 )**: Fix dispatch config type for skipBubbling ([#24109](facebook/react#24109)) //<Luna>// - **[ef23a9ee8](facebook/react@ef23a9ee8 )**: Flag for text hydration mismatch ([#24107](facebook/react#24107)) //<salazarm>// - **[0412f0c1a](facebook/react@0412f0c1a )**: add offscreen state node ([#24026](facebook/react#24026)) //<Luna Ruan>// - **[43eb28339](facebook/react@43eb28339 )**: Add skipBubbling property to dispatch config ([#23366](facebook/react#23366)) //<Luna>// - **[832e2987e](facebook/react@832e2987e )**: Revert accdientally merged PR ([#24081](facebook/react#24081)) //<Andrew Clark>// - **[02b65fd8c](facebook/react@02b65fd8c )**: Allow updates at lower pri without forcing client render //<Andrew Clark>// - **[83b941a51](facebook/react@83b941a51 )**: Add isRootDehydrated function //<Andrew Clark>// - **[c8e4789e2](facebook/react@c8e4789e2 )**: Pass children to hydration root constructor //<Andrew Clark>// - **[581f0c42e](facebook/react@581f0c42e )**: [Flight] add support for Lazy components in Flight server ([#24068](facebook/react#24068)) //<Josh Story>// - **[72a933d28](facebook/react@72a933d28 )**: Gate legacy hidden ([#24047](facebook/react#24047)) //<Sebastian Markbåge>// - **[b9de50d2f](facebook/react@b9de50d2f )**: Update test to reset modules instead of using private state ([#24055](facebook/react#24055)) //<Sebastian Markbåge>// - **[c91892ec3](facebook/react@c91892ec3 )**: [Fizz] Don't flush empty segments ([#24054](facebook/react#24054)) //<Sebastian Markbåge>// - **[d5f1b067c](facebook/react@d5f1b067c )**: [ServerContext] Flight support for ServerContext ([#23244](facebook/react#23244)) //<salazarm>// - **[6edd55a3f](facebook/react@6edd55a3f )**: Gate unstable_expectedLoadTime on enableCPUSuspense ([#24038](facebook/react#24038)) //<Sebastian Markbåge>// - **[57799b912](facebook/react@57799b912 )**: Add more feature flag checks ([#24037](facebook/react#24037)) //<Sebastian Markbåge>// - **[e09518e5b](facebook/react@e09518e5b )**: [Fizz] write chunks to a buffer with no re-use ([#24034](facebook/react#24034)) //<Josh Story>// - **[14c2be8da](facebook/react@14c2be8da )**: Rename Node SSR Callbacks to onShellReady/onAllReady and Other Fixes ([#24030](facebook/react#24030)) //<Sebastian Markbåge>// - **[cb1e7b1c6](facebook/react@cb1e7b1c6 )**: Move onCompleteAll to .allReady Promise ([#24025](facebook/react#24025)) //<Sebastian Markbåge>// - **[566285761](facebook/react@566285761 )**: [Fizz] Export debug function for FB ([#24024](facebook/react#24024)) //<salazarm>// - **[05c283c3c](facebook/react@05c283c3c )**: Fabric HostComponent as EventEmitter: support add/removeEventListener (unstable only) ([#23386](facebook/react#23386)) //<Joshua Gross>// - **[08644348b](facebook/react@08644348b )**: Added unit Tests in the ReactART, increasing the code coverage ([#23195](facebook/react#23195)) //<BIKI DAS>// - **[feefe437f](facebook/react@feefe437f )**: Refactor Cache Code ([#23393](facebook/react#23393)) //<Luna Ruan>// Changelog: [General][Changed] - React Native sync for revisions 1780659...1159ff6 jest_e2e[run_all_tests] Reviewed By: lunaleaps Differential Revision: D34928167 fbshipit-source-id: 8c386f2be5871981d217ab9a514892ed88eafcfb
Summary: This sync includes the following changes: - **[3f8990898](facebook/react@3f8990898 )**: Fix test-build-devtools if build was generated by build-for-devtools ([facebook#24088](facebook/react#24088)) //<Sebastian Silbermann>// - **[577f2de46](facebook/react@577f2de46 )**: enableCacheElement flag ([facebook#24131](facebook/react#24131)) //<David McCabe>// - **[2e0d86d22](facebook/react@2e0d86d22 )**: Allow updating dehydrated root at lower priority without forcing client render ([facebook#24082](facebook/react#24082)) //<Andrew Clark>// - **[dbe9e732a](facebook/react@dbe9e732a )**: Avoid conditions where control flow is sufficient ([facebook#24126](facebook/react#24126)) //<Sebastian Markbåge>// - **[b075f9742](facebook/react@b075f9742 )**: Fix dispatch config type for skipBubbling ([facebook#24109](facebook/react#24109)) //<Luna>// - **[ef23a9ee8](facebook/react@ef23a9ee8 )**: Flag for text hydration mismatch ([facebook#24107](facebook/react#24107)) //<salazarm>// - **[0412f0c1a](facebook/react@0412f0c1a )**: add offscreen state node ([facebook#24026](facebook/react#24026)) //<Luna Ruan>// - **[43eb28339](facebook/react@43eb28339 )**: Add skipBubbling property to dispatch config ([facebook#23366](facebook/react#23366)) //<Luna>// - **[832e2987e](facebook/react@832e2987e )**: Revert accdientally merged PR ([facebook#24081](facebook/react#24081)) //<Andrew Clark>// - **[02b65fd8c](facebook/react@02b65fd8c )**: Allow updates at lower pri without forcing client render //<Andrew Clark>// - **[83b941a51](facebook/react@83b941a51 )**: Add isRootDehydrated function //<Andrew Clark>// - **[c8e4789e2](facebook/react@c8e4789e2 )**: Pass children to hydration root constructor //<Andrew Clark>// - **[581f0c42e](facebook/react@581f0c42e )**: [Flight] add support for Lazy components in Flight server ([facebook#24068](facebook/react#24068)) //<Josh Story>// - **[72a933d28](facebook/react@72a933d28 )**: Gate legacy hidden ([facebook#24047](facebook/react#24047)) //<Sebastian Markbåge>// - **[b9de50d2f](facebook/react@b9de50d2f )**: Update test to reset modules instead of using private state ([facebook#24055](facebook/react#24055)) //<Sebastian Markbåge>// - **[c91892ec3](facebook/react@c91892ec3 )**: [Fizz] Don't flush empty segments ([facebook#24054](facebook/react#24054)) //<Sebastian Markbåge>// - **[d5f1b067c](facebook/react@d5f1b067c )**: [ServerContext] Flight support for ServerContext ([facebook#23244](facebook/react#23244)) //<salazarm>// - **[6edd55a3f](facebook/react@6edd55a3f )**: Gate unstable_expectedLoadTime on enableCPUSuspense ([facebook#24038](facebook/react#24038)) //<Sebastian Markbåge>// - **[57799b912](facebook/react@57799b912 )**: Add more feature flag checks ([facebook#24037](facebook/react#24037)) //<Sebastian Markbåge>// - **[e09518e5b](facebook/react@e09518e5b )**: [Fizz] write chunks to a buffer with no re-use ([facebook#24034](facebook/react#24034)) //<Josh Story>// - **[14c2be8da](facebook/react@14c2be8da )**: Rename Node SSR Callbacks to onShellReady/onAllReady and Other Fixes ([facebook#24030](facebook/react#24030)) //<Sebastian Markbåge>// - **[cb1e7b1c6](facebook/react@cb1e7b1c6 )**: Move onCompleteAll to .allReady Promise ([facebook#24025](facebook/react#24025)) //<Sebastian Markbåge>// - **[566285761](facebook/react@566285761 )**: [Fizz] Export debug function for FB ([facebook#24024](facebook/react#24024)) //<salazarm>// - **[05c283c3c](facebook/react@05c283c3c )**: Fabric HostComponent as EventEmitter: support add/removeEventListener (unstable only) ([facebook#23386](facebook/react#23386)) //<Joshua Gross>// - **[08644348b](facebook/react@08644348b )**: Added unit Tests in the ReactART, increasing the code coverage ([facebook#23195](facebook/react#23195)) //<BIKI DAS>// - **[feefe437f](facebook/react@feefe437f )**: Refactor Cache Code ([facebook#23393](facebook/react#23393)) //<Luna Ruan>// Changelog: [General][Changed] - React Native sync for revisions 1780659...1159ff6 jest_e2e[run_all_tests] Reviewed By: lunaleaps Differential Revision: D34928167 fbshipit-source-id: 8c386f2be5871981d217ab9a514892ed88eafcfb
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
This issue was closed because it has been stalled for 7 days with no activity. |
🐛 Bug Report
The picker on Android is always shown as a dropdown, even if the mode is set to dialog. On RN 0.58.6 it works according to the mode that is set ("dialog" or "dropdown").
RN 0.59.1
RN 0.58.6
To Reproduce
Initialize a new react native project: react-native init testPicker
Add the code example for the picker attached below to the return, as well in the constructor this.state = {language: "Java"};
Run the project: react-native run-android
Expected Behavior
I expect that when the picker mode is set to "dialog" (or not set, because the default mode is "dialog") to open the items in a new modal window, not as dropdown anchored to the picker view
Code Example
render() {
return (
<View style={styles.container}>
<Text style={styles.welcome}>Welcome to React Native!</Text>
<Text style={styles.instructions}>To get started, edit App.js</Text>
<Text style={styles.instructions}>{instructions}</Text>
<Picker selectedValue={this.state.language} style={{height: 50, width: 100}} mode={"dialog"} onValueChange={(itemValue, itemIndex) => this.setState({language: itemValue}) }> <Picker.Item label="Java" value="java" /> <Picker.Item label="JavaScript" value="js" /> </Picker>
</View>
);
}
Environment
react-native --version
react-native-cli: 2.0.1
react-native: 0.59.1
react-native info
info
React Native Environment Info:
System:
OS: Windows 10
CPU: (8) x64 Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
Memory: 23.85 GB / 31.88 GB
Binaries:
Yarn: 1.5.1 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 6.4.1 - C:\Program Files\nodejs\npm.CMD
IDEs:
Android Studio: Version 3.3.0.0 AI-182.5107.16.33.5314842
The text was updated successfully, but these errors were encountered: