Skip to content

Bug - DatePicker with Calendar - Carbon for React #4420

Closed
@tahaimt

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

  1. Open a new tab with dev tools in Chrome
  2. Go to React Storybook link for Datepicker
  3. Switch to mobile view
  4. Click on the date input or calendar icon in the date input
  5. Check console
  6. 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

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

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions