Datetimepicker: How to disable DateTimePicker component?

Created on 9 Oct 2020  路  3Comments  路  Source: react-native-datetimepicker/datetimepicker

Hello!
We need to display DateTimePicker component with disabled flag on iOS. Before iOS14 we used a special header with current time and can disable this header to prevent DateTimePicker overlay open. After iOS 14 we don't see any reasons in this header but we can't disable system DateTimePicker component.
As I know, iOS UIDatePicker view has got isEnabled field, that makes what we want: prevent touches and update UI to common disable view (gray text color). As a temp solution we are using another view about our date component, however it doesn't affect component styles. But it would be nice to have the same option in this lib.

good first issue

Most helpful comment

Great question. Today I am adapting using pointerEvents = {"none"} in a view external to DateTimePicker.

All 3 comments

Hello!
We need to display DateTimePicker component with disabled flag on iOS. Before iOS14 we used a special header with current time and can disable this header to prevent DateTimePicker overlay open. After iOS 14 we don't see any reasons in this header but we can't disable system DateTimePicker component.
As I know, iOS UIDatePicker view has got isEnabled field, that makes what we want: prevent touches and update UI to common disable view (gray text color). As a temp solution we are using another view about our date component, however it doesn't affect component styles. But it would be nice to have the same option in this lib.

This is definitely necessary

Great question. Today I am adapting using pointerEvents = {"none"} in a view external to DateTimePicker.

Thanks @PabloTeari wrapping in a View w/ that prop set seems to work! Setting pointerEvents to 'auto' when not disabled.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

StarryFire picture StarryFire  路  3Comments

otaviogaiao picture otaviogaiao  路  5Comments

sorinsi picture sorinsi  路  5Comments

FDiskas picture FDiskas  路  3Comments

wesff picture wesff  路  3Comments