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

[Bug]: DatePicker and DatePicker input are not clickable when loaded with React.lazy #10692

Closed
2 tasks done
bkarolyi opened this issue Feb 10, 2022 · 1 comment · Fixed by #12969
Closed
2 tasks done
Assignees
Labels
Milestone

Comments

@bkarolyi
Copy link

Package

carbon-components-react

Browser

Chrome

Package version

v10.52.0

React version

v.17.0.2

Description

When I import the DatePicker and DatePickerInput components with React.lazy, the date picker does not set up well.
Calendar does not appear when I click on the date input.
In addition when I tested I found that in some cases the initial date value that I add to the DatePickerInput component's value property does not appear in the input.

It seems that other carbon react form components work well with React lazy.

Additional info:
The example code from the codebox works well without React lazy:
https://codesandbox.io/s/carbon-react-datepicker-non-lazy-example-ldj4x

react-flatpickr works well with React lazy:
https://codesandbox.io/s/react-flatpickr-lazy-example-gvwmy

CodeSandbox example

https://codesandbox.io/s/carbon-react-datepicker-lazy-example-xr50d

Steps to reproduce

  • import DatePicker and DatePickerInput components with React lazy. You can use react-lazily for lazy import. It can handle destructuring during import.
  • Wrap the components in React.Suspense with any fallback property.

Code of Conduct

@joshblack joshblack moved this to 🕵️‍♀️ Triage in Design System Feb 21, 2022
@joshblack joshblack moved this from 🕵️‍♀️ Triage to ⏱ Backlog in Design System Feb 21, 2022
@joshblack
Copy link
Contributor

Hi there @bkarolyi! 👋 Thanks for taking the time to fill out this issue and for the codesandboxes, they're incredibly helpful and appreciated!

We can recreate the issue on your codesandbox (after bumping the styles up to v10) and can see the calendar not showing up. We'll add this issue to our project board and try and prioritize it in a future sprint.

@tay1orjones tay1orjones self-assigned this Oct 20, 2022
@tay1orjones tay1orjones added this to the 2022 Q4 milestone Nov 3, 2022
@tay1orjones tay1orjones assigned tw15egan and unassigned tay1orjones Nov 16, 2022
@tay1orjones tay1orjones modified the milestones: 2022 Q4, 2023 Q1 Jan 4, 2023
@tay1orjones tay1orjones moved this from ⏱ Backlog to 🚦 In Review in Design System Jan 11, 2023
@kodiakhq kodiakhq bot closed this as completed in #12969 Jan 12, 2023
@github-project-automation github-project-automation bot moved this from 🚦 In Review to ✅ Done in Design System Jan 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants