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
637 stars 161 forks source link

presentationStyle not changing anything #361

Closed jrichichi closed 6 months ago

jrichichi commented 6 months ago

Currently, my DatePickerModal is full-screen, no matter the value I pass into presentationStyle.

I'm using the newest version of react-native-paper-dates, 0.20.5, react-native-paper: 5.10.3, expo: 49.0.8, react-native: 0.72.6, and my DatePickerModal looks like this:

 <DatePickerModal
        date={value}
        locale="en"
        mode="single"
        presentationStyle="pageSheet"
        visible={isPickerVisible}
        onDismiss={() => setIsPickerVisible(false)}
        onConfirm={({ date }) => {
          onChange(date);
          setIsPickerVisible(false);
        }}
        inputEnabled={false}
        disableStatusBar
        disableStatusBarPadding
      />

Update: Just using the DatePickerModalContent wrapped in my own Modal seems to work fine for me. Still strange that the prop doesn't function as expected though.

RichardLindhout commented 6 months ago

I'm working on this currently and will release a new version soon!

mbpictures commented 2 months ago

Still having the same issue on version 0.22.7 (android). My component looks like this:

         <DatePickerModal
                presentationStyle='pageSheet'
                locale={i18n.language}
                mode="single"
                visible={dateOpen}
                date={date.current}
                onDismiss={() => {
                    setDateOpen(false);
                    onClose();
                }}
                onConfirm={onConfirmDate}
                validRange={{
                    startDate: minimumDate
                }}
                label={label}
            />

EDIT: I just found this line here. Is there a reason, that pageSheet only works on iOS? Maybe this should be added to the docs.