-
Notifications
You must be signed in to change notification settings - Fork 3.4k
feat(datepicker): year view, open on focus, bug fixes #8472
Conversation
@ThomasBurleson how should we proceed with reviewing this one? I had to shuffle around a lot of code in order to avoid duplication. |
a0117df
to
e5f7b03
Compare
if (!self.selectedDate) self.selectedDate = value; | ||
|
||
// Also set up the displayDate. | ||
if (!self.displayDate) self.displayDate = self.selectedDate || self.today; |
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.
Add braces
High level LGTM from me, thanks! |
e5f7b03
to
d84017a
Compare
@ThomasBurleson @topherfangio @EladBezalel @devversion I've worked through the comments from Jeremy. Can you give me some feedback on this? |
var value = this.$viewValue; | ||
|
||
// Notify the child scopes of any changes. | ||
self.$scope.$broadcast('md-calendar-parent-changed', value); |
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 think we should avoid broadcasting, but if it's inevitable I think it should be md-calendar:parent-changed
You can avoid broadcasting by providing a registerChanges
that you provide on the controller that gets a callback and saves it in a callback array and when the change happened go through the callback array and call it
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.
Doing a registerChanges
method is basically the same as broadcasting it on the scope, except that we'd need to handle keeping track of the callbacks and cleaning up afterwards ourselves.
d84017a
to
2cbb826
Compare
d7a0236
to
440587c
Compare
751d6da
to
043a818
Compare
8df4295
to
8226297
Compare
It should be good to go now @ThomasBurleson. |
Overall, I think this is really great and helpful! A couple of thoughts from a UX perspective:
Just some of my own personal thoughts 😄 |
|
|
@crisbeto - Should i merge this now ? |
8226297
to
0bbe9d9
Compare
I'd say so @ThomasBurleson. Once we have this set up, making improvements should be a bit easier. |
* Adds the ability for users to switch years quicker by clicking on the month header. Cheers to @mhchen for helping me get started. * Adds the ability to open a datepicker by focusing the input. * Fixes alignment issues, if the user has set the `box-sizing: border-box` on everything. * Fixes cases where the calendar's width could be set to 0. Fixes angular#4251, angular#4650, angular#8547, angular#8030, angular#8557.
0bbe9d9
to
aaf4686
Compare
box-sizing: border-box
on everything.Fixes #4251, #4650, #8547, #8030, #8557.