-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
fix(16740): DatePicker calendar close issue on clickAway, DatePicker not running onChange events, DatePicker setting and clearing date in range issues #17072
Conversation
✅ Deploy Preview for carbon-elements ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for v11-carbon-react ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The storybook interaction looks good, but I'm concerned this change as is could have some unintended effects due to how the code is modifying how savedOnClose
is used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I pulled down locally to test and looks good!
You can also close this issue #16991, It's working fine now!
🚀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me! I think we can update the stories to remove the console.logs now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great Work !! 🚀
e93167f
…not running onChange events, DatePicker setting and clearing date in range issues (carbon-design-system#17072) * fix: fixes DatePicker calendar close issue on clickAway * fix(DatePicker): fixes close calendar issue on click away * fix: covers empty value conditions * refactor: updates avt test as per 1.58 version * refactor: reverts changes made by renovate on avt test * refactor: removes callback and dependency from useeffect * refactor: callback is only added to onCalendarClose * refactor: deprecates the usage is setTimeout to use useEffect * refactor: revert storybook changes
Closes #16740
Closes #16710
Closes #17071
Closes #16991
Changelog
(a) Sets up a
mousedown
event listener on the document.(b) Addes a
handleMouseDown
function which checks if any click is made outside thecalendar
(icon) andInputFields
.closeCalendar
function is called immediatelycalendarRef.current.close()
and removes the focus from inputField)clickOutside
while callingonCalendarClose
(to capture it and return without processing )(c) Deprecates the use of setTimeout
setTimeout
tohandleCalendarClose
function.useEffect
is add to callhandleCalendarClose
whenever calendar closesWould love some review on usage of this interface
Testing / Reviewing
Open deploy preview and visit all the storybook examples
Each has demonstration on existing bugs fix (make sure calendar closes on clickaway, dates are rested on clear option, onchange events happens as expected )
Storybook examples needs to be restored or older version before merging