question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Date picker is not showing when the picker is inside the modal

See original GitHub issue

Hi,

I have the modal that open the item details on clicking on the list of items. The picker works fine without the modal but I’d like to show the date picker in the modal. It works perfectly fine on Android. However, on IOS, I’m getting the following error.

Attempt to present <UIAlertController: 0x1049cd800> on <UIViewController: 0x1045121a0> (from <UIViewController: 0x1045121a0>) which is already presenting <RCTModalHostViewController: 0x11a09a720>.

To replicate “react”: “17.0.2”, “react-native”: “^0.65.1”, “react-native-date-picker”: “^4.0.0”,

I use import {Modal} from ‘react-native’;

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:11
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
zhangpeng178commented, Oct 26, 2021
import React, {useState} from 'react';
import {Button, Modal, View} from 'react-native';
import DatePicker from 'react-native-date-picker';

const App = () => {
  const [date, setDate] = useState(new Date());
  const [open, setOpen] = useState(false);
  return (
    <View>
      <Button title="open" onPress={() => setOpen(true)} />
      <Modal visible={open}>
        <DatePicker modal date={date} onDateChange={setDate} />
        <Button title="close" onPress={() => setOpen(false)} />
      </Modal>
    </View>
  );
};

export default App;

modal attribute in DatePicker Ios

0reactions
henninghallcommented, Dec 6, 2021

This should now have been solved in v4.1.3, please try it out and let me know if it fixed it for you 🙂

Read more comments on GitHub >

github_iconTop Results From Across the Web

DatePicker not working inside a modal - Stack Overflow
The reason it's not working for you is because your datepicker is being bound to elements that exist at the time the script...
Read more >
Datepicker not working inside of Modal Window #2736 - GitHub
Hello All,. I am trying to manage ngx-date picker in modal popup at the time of scrolling it's not move with date text...
Read more >
UI page : jquery datepicker not working inside bootstrap modal
It seems like some JS library(from UI page) is conflicting with the datepicker JS. I have tried different ways to counter it but...
Read more >
Datetime picker not working in dynamic modal - Laracasts
Its a problem with event registering + data that load later. ... Your js will create new datepicker instance all the time, when...
Read more >
Datepicker not working inside of Modal - YouTube
Datepicker not working inside of Modal. 3.3K views 4 years ago. Binary 777. Binary 777. 46 subscribers. Subscribe. 7. I like this.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found