-
Notifications
You must be signed in to change notification settings - Fork 80
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(date-picker): add null check for optional date control #1051
fix(date-picker): add null check for optional date control #1051
Conversation
Thank you, 🤖 Clarity Release Bot |
@twittwer, we have received your signed contributor license agreement. The review is usually completed within a week, but may take longer under certain circumstances. Another comment will be added to the pull request to notify you when the merge can proceed. |
@twittwer, VMware has approved your signed contributor license agreement. |
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.
Thanks!
@kevinbuhmann How would you like to proceed with the failing test? ng-clarity/projects/angular/src/forms/datepicker/date-input.spec.ts Lines 109 to 111 in 7cfeb3b
Before it tests that Should I test the opposite and check it is not called, or remove it? |
We should have a test for both possibilities. |
59c156c
to
12dc9bb
Compare
Ok, I checked it out locally and now lint & test should succeed. |
12dc9bb
to
090ba6f
Compare
I hope running |
@kevinbuhmann What is required to get this merged & released? |
I will get this merged today. |
This is a forward-port of df02084 to 17.x (next).
Can you say when the next release will be published? |
@kevinbuhmann Can you estimate a time for next release with this fix? |
🎉 This PR is included in version 16.1.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Hi there 👋, this is an automated message. To help Clarity keep track of discussions, we automatically lock closed PRs after 14 days. Please look for another open issue or open a new issue with updated details and reference this one as necessary. |
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
The
control
property ofClrDateInput
's is marked as optional and can therefore benull
.ng-clarity/projects/angular/src/forms/datepicker/date-input.ts
Lines 72 to 74 in 7cfeb3b
But the
WrappedControl
which is extended byClrDateInput
doesn't handle nullable controls.ng-clarity/projects/angular/src/forms/common/wrapped-control.ts
Line 57 in 7cfeb3b
This causes
TypeError: Cannot read properties of null (reading 'control')
when usingclrDate
and callingmarkAllAsTouched
on a surrounding form.ng-clarity/projects/angular/src/forms/common/wrapped-control.ts
Lines 146 to 149 in 7cfeb3b
What is the new behavior?
The
WrappedControl
is now typed with nullable control and checks for its existence before using it.Does this PR introduce a breaking change?
Other information