Bug - DatePicker with Calendar - Carbon for React #4420
Closed
Description
Datepicker open and set methods are not available in mobile devices. Due to as issue with rerendering of the input after the maxDate and minDate prop values are changed, I was advised to use set method using the datepicker ref (ref.current.cal.set({ maxDate: new Date() }))
which wont work on android.
What package(s) are you using?
-
carbon-components
- ver: 10.5.1 -
carbon-components-react
- ver: 7.5.1
Detailed description
Throwing errors on console when opened in mobile view
Steps to reproduce the issue
- Open a new tab with dev tools in Chrome
- Go to React Storybook link for Datepicker
- Switch to mobile view
- Click on the date input or calendar icon in the date input
- Check console
- You should see an error
vendors~main.ea56bc5986fd20de4d78.bundle.js:93 Uncaught TypeError: _this.cal.open is not a function
I think the calendar implementation is done differently for different devices. I opened the link on my android phone and it opened the android calendar. However, since I am using internal methods of datepicker for my use case and although it works fine on desktop, it wont on mobile.
Activity