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

Control when you want to focus initial date in Calendar #463

Closed
wants to merge 4 commits into from
Closed

Control when you want to focus initial date in Calendar #463

wants to merge 4 commits into from

Conversation

millnitzluan
Copy link

  • I have changed my target branch to develop 👊

Closes #450

Description

Created prop to control when you want to focus initial date, the default value of initialFocusedDate is true, so when you want to disable it, you only need to set to false.

@millnitzluan
Copy link
Author

@dmtrKovalenko, when I was sending initialFocusedDate in DatePicker props I was getting this error:

Warning: React does not recognize the `initialFocusedDate` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `initialfocuseddate` instead. If you accidentally passed it from a parent component, remove it from the DOM element.

Do you know how to solve it?

@dmtrKovalenko
Copy link
Member

Yes. You need to spread this prop from passing to ModalWrapper and DateTextField

@dmtrKovalenko
Copy link
Member

And also the property should be named something like toFocusDateInitially or shouldFocusDateInitially. Just follow the convention for Boolean props

@millnitzluan
Copy link
Author

Okay bro, I'll fix this 👍

Copy link
Member

@cherniavskii cherniavskii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

initialFocusedDate doesn't sound like a boolean to me. I'd expect this prop toreceive a Date to focus on.

Also, from a fast look at #450, @mcMickJuice rather meant it to be a date value prop.

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

Successfully merging this pull request may close these issues.

3 participants