-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Set TimePicker.Time seconds to zero when UseSeconds is False #17251
Conversation
You can test this PR using the following package version. |
Thank you, the change looks reasonable to me. |
I had a go at that, and my AV got upset, but I'll try again. May take a bit of time for me to work out how to test it sensibly. |
cda7d67
to
eeab954
Compare
Pushed a couple of simple tests: not sure if they are up to muster; obviously I'm happy to change anything with a bit of direction. Should the I had a lot of trouble with the templating the
Note that the test explicitly invoke the |
You can test this PR using the following package version. |
Looks like I've broken something, but no idea why (Appium makes my AV unhappy to didn't run those locally). Will take another look in a few hours/tomorrow. |
eeab954
to
5a4b058
Compare
You can test this PR using the following package version. |
Rebased against master and tests stopped failing; not sure those are related. |
[TemplatePart("PART_FirstSpacer", typeof(Rectangle), IsRequired = true)] | ||
[TemplatePart("PART_SecondSpacer", typeof(Rectangle), IsRequired = true)] | ||
[TemplatePart("PART_ThirdSpacer", typeof(Rectangle), IsRequired = true)] |
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.
Just a sanity check, are these really required? I.e. will control work fine, if these spacers were missing, without any C# code change. For example, a third-party theme.
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.
ApplyTemplate
crashed when I didn't include them in the test template, so I added them here as they seemed to be missing.
It did seem odd that they are required: I considered making them not required, but decided the test code was messy enough without my trying to break anything else.
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 like FirstSpacer doesn't need to exist (isn't used at all, which is a bit odd), but SecondSpacer is assumed in the code. I'll remove FirstSpacer or make any other suggested changes tomorrow.
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.
Yep, they're unfortunately needed currently. We should refactor these templates someday: I'm sure a lot of parts could be made optional and/or simple styles added to the themes instead. Anyways, such a refactoring isn't the point of this PR :)
626fb8c
to
144a90d
Compare
You can test this PR using the following package version. |
They aren't related, these specific integration tests are unfortunately flaky, you can ignore them for now. I'm hoping #17259 will help them pass... |
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.
LGTM, thanks!
You can test this PR using the following package version. |
* Set TimePickerPresenter.Time seconds component to zero when UseSeconds is false * Remove unneeded PART_FirstSpace annotation from TimePickerPresenter --------- Co-authored-by: Julien Lebosquain <julien@lebosquain.net>
What does the pull request do?
Addresses the most significant issue (breaking change) discussed in #17024
What is the current behavior?
The seconds component of the Time property is always set to an uncontrolled value when
UseSeconds
is false.What is the updated/expected behavior with this PR?
When
UseSeconds
is false, the Time property has its seconds component set to zeroHow was the solution implemented (if it's not obvious)?
N/A
Checklist
Breaking changes
N/A
Obsoletions / Deprecations
N/A
Fixed issues
Fixes part of #17024