web-ridge / react-native-paper-dates

Smooth and fast cross platform Material Design date and time picker for React Native Paper
https://www.reactnativepaperdates.com
MIT License
657 stars 170 forks source link

Date picker modal not showing in android #121

Closed premdasvm closed 2 years ago

premdasvm commented 2 years ago

Hi, I was trying to implement the date picker onto my application, but the date picker modal isn't showing up on my android version, on IOS it works like charm, can someone help me out here.?

<DatePickerInput
    locale="en"
    label="Valid till date"
    value={inputDate}
    onChange={d => {
      console.log(d)
    }}
   inputMode="start"
   mode="outlined"
   style={{width: '90%', marginTop: '2.5%'}}
/>

video_2021-11-29_16-48-15

premdasvm commented 2 years ago

Removing mode="outlined" seem to fixed it.

RichardLindhout commented 2 years ago

Hmm I think it should work with outlined but I only tested it on the web & iOS and not on Android yet

professionally commented 2 years ago

Hi. Had the same problem. I fixed it by adding a zindex to the styles.calendarButton in line 130 in src/Date/DatePickerInput.tsx. This will also work for outlined-mode. After that, I used patch-package to patch it locally for me.

const styles = StyleSheet.create({
  root: {
    minWidth: 150,
    flexDirection: 'row',
    position: 'relative',
    alignItems: 'center',
    flexGrow: 1,
    alignSelf: 'flex-start'
  },
  input: {
    flexGrow: 1,
  },
  calendarButton: { position: 'absolute', right: 0, zIndex:1000 },
})
export default React.forwardRef(DatePickerInput)
RichardLindhout commented 2 years ago

This should be fixed now! Thanks @professionally