react-native-ui-lib: Confirm Button is missing in DateTimePicker spinner using iOS newer versions

Description

In iOS, using v 16.0.3 and 17.4.1, confirm icon in DateTimePicker is missing. Its only fails in production, i cant reproduce the error using ExpoGo

Related to

  • Components
  • Demo
  • Docs
  • Typings

Steps to reproduce

  1. Implements a DateTimePicker

  2. Deploy the app on AppStore

  3. Open the DateTimePicker. The confirm button doesnt exists. This error make impossible to complete the form

Expected behavior

Have the cancel and confirm Buttons in the DateTimePicker component, using spinner display in any iOS version

Actual behavior

When using iOS v 16.0.3 and 17.4.1, the confirm button is missing and the DateTimePicker cannot be confirmed

More Info

Code snippet

import React, {useEffect} from 'react';
import {StyleSheet} from 'react-native';
import {View, DateTimePicker, Colors} from 'react-native-ui-lib';
import dayjs from 'dayjs';

const DatePicker = ({editable = true, ...props}) => {
  useEffect(() => {
    if (props.setInitialDate) {
      props.onChange(new Date());
    }
  }, []);
  let BG_COLOR = Colors.foreground;
  let BORDER_COLOR = Colors.themeSecondary;
  let inputColor = {
    backgroundColor: BG_COLOR,
    borderColor: BORDER_COLOR,
  };

  if (!editable) {
    inputColor.backgroundColor = Colors.disabled;
  }

  return (
    <View>
      <DateTimePicker
        style={{...fieldStyle, ...inputColor}}
        enableErrors={false}
        hideUnderline
        color={Colors.textInputPrimary}
        dateTimeFormatter={val => dayjs(val).format('DD-MM-YY')}
        editable={editable}
        placeholderTextColor={Colors.primary}
        height={45}
        headerStyle={containerStyle}
        {...props}
      />
    </View>
  );
};

const {fieldStyle, containerStyle} = StyleSheet.create({
  fieldStyle: {
    borderWidth: 2,
    borderRadius: 8,
    padding: 8,
    paddingLeft: 16,
  },
  containerStyle: {
    color: Colors.$textDefault,
    backgroundColor: Colors.foreground,
  },
});

export default DatePicker;


Screenshots/Video

(tested in ExpoGo first, and real app later)

https://github.com/wix/react-native-ui-lib/assets/104790946/9423dd81-6bcd-419e-a66c-f024de0619be

Environment

  • React Native version: 0.73.6
  • React Native UI Lib version: 7.17.0
  • Expo version : 50.0.15

Affected platforms

  • Android
  • iOS
  • Web

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 3
  • Comments: 27

Most upvoted comments

I added some props to the DateTimePicker component and it works 😃

image IMG_1735

@emprecario I liked your approach and thank you for sharing it. However, in the end I used a different solution:

react-native-ui-lib+7.21.2.patch:

diff --git a/node_modules/react-native-ui-lib/src/assets/icons/check-small@1.5x.png b/node_modules/react-native-ui-lib/src/assets/icons/check-small@1.5x.png
deleted file mode 100644
index 902f55c..0000000
Binary files a/node_modules/react-native-ui-lib/src/assets/icons/check-small@1.5x.png and /dev/null differ
diff --git a/node_modules/react-native-ui-lib/src/assets/icons/check-small@4x.png b/node_modules/react-native-ui-lib/src/assets/icons/check-small@4x.png
deleted file mode 100644
index 8346c27..0000000
Binary files a/node_modules/react-native-ui-lib/src/assets/icons/check-small@4x.png and /dev/null differ
diff --git a/node_modules/react-native-ui-lib/src/assets/icons/check@1.5x.png b/node_modules/react-native-ui-lib/src/assets/icons/check@1.5x.png
deleted file mode 100644
index c43c034..0000000
Binary files a/node_modules/react-native-ui-lib/src/assets/icons/check@1.5x.png and /dev/null differ
diff --git a/node_modules/react-native-ui-lib/src/assets/icons/check@4x.png b/node_modules/react-native-ui-lib/src/assets/icons/check@4x.png
deleted file mode 100644
index 5495134..0000000
Binary files a/node_modules/react-native-ui-lib/src/assets/icons/check@4x.png and /dev/null differ
diff --git a/node_modules/react-native-ui-lib/src/assets/icons/minusSmall@1.5x.png b/node_modules/react-native-ui-lib/src/assets/icons/minusSmall@1.5x.png
deleted file mode 100644
index a1b0d0e..0000000
Binary files a/node_modules/react-native-ui-lib/src/assets/icons/minusSmall@1.5x.png and /dev/null differ
diff --git a/node_modules/react-native-ui-lib/src/assets/icons/minusSmall@4x.png b/node_modules/react-native-ui-lib/src/assets/icons/minusSmall@4x.png
deleted file mode 100644
index 62ef8d1..0000000
Binary files a/node_modules/react-native-ui-lib/src/assets/icons/minusSmall@4x.png and /dev/null differ
diff --git a/node_modules/react-native-ui-lib/src/assets/icons/plusSmall@1.5x.png b/node_modules/react-native-ui-lib/src/assets/icons/plusSmall@1.5x.png
deleted file mode 100644
index f9b22af..0000000
Binary files a/node_modules/react-native-ui-lib/src/assets/icons/plusSmall@1.5x.png and /dev/null differ
diff --git a/node_modules/react-native-ui-lib/src/assets/icons/plusSmall@4x.png b/node_modules/react-native-ui-lib/src/assets/icons/plusSmall@4x.png
deleted file mode 100644
index 1288bb4..0000000
Binary files a/node_modules/react-native-ui-lib/src/assets/icons/plusSmall@4x.png and /dev/null differ
diff --git a/node_modules/react-native-ui-lib/src/assets/icons/search@1.5x.png b/node_modules/react-native-ui-lib/src/assets/icons/search@1.5x.png
deleted file mode 100644
index ebc5f85..0000000
Binary files a/node_modules/react-native-ui-lib/src/assets/icons/search@1.5x.png and /dev/null differ
diff --git a/node_modules/react-native-ui-lib/src/assets/icons/search@4x.png b/node_modules/react-native-ui-lib/src/assets/icons/search@4x.png
deleted file mode 100644
index 2dd5199..0000000
Binary files a/node_modules/react-native-ui-lib/src/assets/icons/search@4x.png and /dev/null differ

Basically, I deleted all the assets with prefixes @4x and @1.5x image

And now works image

This is still an issue.

iOS simulator 18.2

"expo": "51.0.0",
"react-native": "0.73.8",
"react-native-ui-lib": "7.38.1",

The workaround mentioned by @bsalasA3 does work. Explicitly adding the confirmButtonProps property causes the confirm button to render.

<DateTimePicker
  confirmButtonProps={{
    "color": "black",
  }}
/>