-
Notifications
You must be signed in to change notification settings - Fork 177
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
DatePickerInput rendering behind other components #422
Comments
Hey! Thanks for opening the issue. Can you provide more information about the issue? Please fill the issue template when opening the issue without deleting any section. We need all the information we can, to be able to help. Make sure to at least provide - Current behaviour, Expected behaviour, A way to reproduce the issue with minimal code (link to snack.expo.dev) or a repo on GitHub, and the information about your environment (such as the platform of the device, versions of all the packages etc.). |
Hey! Thanks for opening the issue. Can you provide a minimal repro which demonstrates the issue? Posting a snippet of your code in the issue is useful, but it's not usually straightforward to run. A repro will help us debug the issue faster. Please try to keep the repro as small as possible. The easiest way to provide a repro is on snack.expo.dev. If it's not possible to repro it on snack.expo.dev, then you can also provide the repro in a GitHub repository. |
Hi, there was actually a link to repo there, but maybe it was easy to miss, I updated the description so now maybe it is clearer how to reproduce the issue. I also added a note on why I did not put it on snack.expo.dev - in short, I was not able to reproduce it there. I had to simplify the app setup and for some reason everything worked fine there, which only adds to my confusion. I am starting to wonder whether maybe it has something to do with my phone more than with the package. |
I just installed this library. I've the same issue with the single DatePicker. On web it renders fine but on mobile it overflows the other elements. I fixed it for mobile with |
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. |
I just verified that the issue is still present in the latest version of the package. The repro steps remain the same, and the workaround is to wrap the date picker with |
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. |
Not stale, issue is still present. |
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. |
Screens should have flex: 1 as container style |
Current behaviour
The
DatePickerInput
renders in a wrong place. See the code and images below. The way I see it, text inputs render exactly where they would render if there was noDatePickerInput
, and theDatePickerInput
renders too high (see the first image). Also note the following:style={{ flex: 1 }}
to the View which wraps theDatePickerInput
and all text inputs, there is no overlap, however the date picker input tries to take up the whole remaining space (see the second image)Expected behaviour
I would imagine that the date picker input should render between the first and the second text inputs with no overlapping, and also that it would not stretch when I apply flex: 1 to the parent view.
How to reproduce?
app/index.tsx
with the following:Or instead of running these steps, you can just clone this repo: https://github.com/maciejors/date-picker-app
I then run
npm start
and view the app on my Android phone using Expo Go app.Note: I was not able to reproduce this problem on snack.expo.dev. For some reason, it works fine there, which adds to my confusion. However, the code I used to reproduce it there was different to the one in repo due to the limitations of snack.expo.dev - I had to remove
_layout.tsx
,app.json
, etc., and put the code fromapp/index.tsx
straight intoApp.tsx
there. I do not have much experience with React Native, so I do not know how much difference it makes, either way this is the reason I provide a link to repo here instead of a link to snack app. As I mentioned, all the code from the repo aside fromapp/index.tsx
is auto-generated bycreate-expo-app
so it should be straightforward to reproducePreview
Image on the left: this variant uses the code exactly as in the repo
Image on the right: this is the variant where flex: 1 is added to the parent view:
<View style={{ flex: 1 }}>
What have I tried so far?
SafeAreaProvider
, and also usingSafeAreaView
instead of the parentView
in the code above. The former has no effect, the latter shifts everything down by half the height of a singleTextInput
;DatePickerInput
with an extra view and applying z-index (no effect).height
in the style for theDateInputPicker
(it moves the "Enter Date" text a little, but otherwise has no effect)DatePickerInput
with a view withpaddingVertical: 28
makes everything look as expected, but I feel like this should not be necessary. However, it is a good temporary solution.My Environment
more information on the packages can be found in the
package.json
from the repo I linked aboveThe text was updated successfully, but these errors were encountered: