Skip to content
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

"Confirm" and "Cancel" buttons don't work in portrait mode (iOS) #485

Closed
Aleksandern opened this issue Oct 20, 2020 · 19 comments
Closed

"Confirm" and "Cancel" buttons don't work in portrait mode (iOS) #485

Aleksandern opened this issue Oct 20, 2020 · 19 comments

Comments

@Aleksandern
Copy link

Aleksandern commented Oct 20, 2020

Environment

Platforms

Versions

Description

"Confirm" and "Cancel" buttons don't work in portrait mode (not tappable).
ezgif-2-801985478e51

code:

import React, { useState } from "react";
import { Button, View } from "react-native";
import DateTimePickerModal from "react-native-modal-datetime-picker";

const Example = () => {
  const [isDatePickerVisible, setDatePickerVisibility] = useState(false);

  const showDatePicker = () => {
    setDatePickerVisibility(true);
  };

  const hideDatePicker = () => {
    setDatePickerVisibility(false);
  };

  const handleConfirm = (date) => {
    console.warn("A date has been picked: ", date);
    hideDatePicker();
  };

  return (
    <View>
      <Button title="Show Date Picker" onPress={showDatePicker} />
      <DateTimePickerModal
        isVisible={isDatePickerVisible}
        mode="date"
        onConfirm={handleConfirm}
        onCancel={hideDatePicker}
      />
    </View>
  );
};

export default Example;

Reproducible Demo

@Aleksandern Aleksandern changed the title "Confirm" and "Cancel" buttons don't work (iOS) "Confirm" and "Cancel" buttons don't work in portrait mode (iOS) Oct 20, 2020
@midoalone
Copy link

midoalone commented Oct 20, 2020

@Aleksandern did you get a solution for this? I am also facing it on iOS 14

@Aleksandern
Copy link
Author

@midoalone
No I didn't. I've just posted it.

@midoalone
Copy link

@Aleksandern I discovered that this issue is related to react native Modal class not this library, I am searching for a solution and hope I find a fix
I think it is related to react native 62.2 version

@Aleksandern
Copy link
Author

Aleksandern commented Oct 21, 2020

@midoalone
14.1 update fixed that.

@Aleksandern
Copy link
Author

It looks like this error is still happening on iOS 14.1

@mmazzarolo
Copy link
Owner

🤔 I'll give it a try this weekend. @midoalone do you have any links on the subject?
Thanks for starting the discussion btw

@mmazzarolo
Copy link
Owner

Working fine in the example, using:

  • "react": "16.13.1",
  • "react-native": "0.63.2",

iPhone 11 - 14.0

2020-10-23 19 49 33

@czegarram
Copy link

I'm experiencing the same issue in ios 14.

React: 16.9.0
React Native: 0.63.3

Simulator Screen Shot - iPhone 11 - 2020-10-24 at 18 06 46

@czegarram
Copy link

I also tried with:

"react": "16.13.1",
"react-native": "0.63.2",

but no luck.

@mmazzarolo
Copy link
Owner

mmazzarolo commented Oct 25, 2020 via email

@mmazzarolo
Copy link
Owner

Can't debug this without a minimal reproducible code. Also, the example is working fine for my tests, so I'm closing the issue.

@OlegPanfyorov
Copy link

Faced exactly the same issue :((((

@dylan-westbury
Copy link

dylan-westbury commented Jan 5, 2021

Facing this issue also. Can't click the confirm or cancel buttons, nothing happens.

iPhone 11 simulator ios 14.3

"react-native-modal-datetime-picker": "^9.1.0",
"@react-native-community/datetimepicker": "^3.0.9",
"react-native": "0.63.3",
"react": "16.13.1",

@dylan-westbury
Copy link

I tried upgrading to react-native 63.4 and not fixed.

@mmazzarolo I have created a reproducable repo

https://github.com/dylan-westbury/datepicker-reproduce-confirm-cancel-bug

Running on ios 14.3 iphone 11

@mmazzarolo
Copy link
Owner

@dylan-westbury thank you. Is the example working for you?

@mmazzarolo mmazzarolo reopened this Jan 5, 2021
@dylan-westbury
Copy link

@mmazzarolo no can't press cancel or confirm in portrait mode

@mmazzarolo
Copy link
Owner

mmazzarolo commented Jan 10, 2021

@dylan-westbury

Screen.Recording.2021-01-10.at.18.00.20.mov

@binlaniua
Copy link

binlaniua commented Mar 12, 2021

facebook/flipper#1399 (comment)

facebook/react-native#29492 (comment)

@PentamapRainer
Copy link

Any solution on this behavior?

Portrait_Mode.mov

When opening the DatePicker in landscape mode, the view changes to portrait mode. When closing the DatePicker, the view changes to landscape mode again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants