You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 5, 2024. It is now read-only.
Repository navigation
This repository was archived by the owner on Sep 5, 2024. It is now read-only.
datepicker: migrate to use mdPanel container #9564
Tracking issue for using the mdPanel in datepicker. Any related issues that appear during the migration should refer to this issue as a primary use case.
@ErinCoughlan I got the datepicker positioning working without too much hassle, however I ran in a couple of issues that could be solved in the panel:
The withOffsetX and withOffsetY only accept string offsets and didn't work (nor complain) at all when supplied a number. I think that we could safely assume that if it's a number, it's in pixels and we can append the unit automatically.
Currently the offsets need to be known ahead of time, however it would be useful if we could pass in a function that determines the offset later. The API could look like this:
mdPanelPosition.withOffsetX(function(dimensionOfTargetElement){returnwhateverOffsetShouldBeSet;// this can be based on the passed in dimensions.});
Point 2 could technically be done in the open callback, however in slower browsers (e.g. IE and Edge) the adjustment is pretty visible.
@crisbeto I like the idea of allowing a function as well as assuming the 'px' if supplied a number. I think that can help prevent some user errors. Please file separate Issues for each of those bugs and we can tackle them to improve the datepicker.
@ErinCoughlan another one I ran into: at the moment, you can set the panel to close via clicking outside or pressing escape, however the datepicker also has the case where it closes the calendar if the user tabs away. Do you think it makes sense to have the "close on" keys configurable through $mdPanel or just continue handling it within the calendar?
@crisbeto I think tab makes a lot of sense. That's also used in popovers, basically if you tab past the end, focus leaves instead of being trapped.
I'm wondering two things in terms of use and API:
Should tab outside panel always close the panel if trapFocus is false? This is more from an accessibility point of view and perhaps it doesn't make sense to be a requirement at the panel level, but I think it's usually the case.
What other keys can/should close the panel? The only others I can think of it ctrl + ? For a help panel, but I'm not sure that's a common case. I ask because I'm trying to figure out how flexible this needs to be.
Activity
crisbeto commentedon Sep 13, 2016
@ErinCoughlan I got the datepicker positioning working without too much hassle, however I ran in a couple of issues that could be solved in the panel:
withOffsetXandwithOffsetYonly accept string offsets and didn't work (nor complain) at all when supplied a number. I think that we could safely assume that if it's a number, it's in pixels and we can append the unit automatically.Point 2 could technically be done in the
opencallback, however in slower browsers (e.g. IE and Edge) the adjustment is pretty visible.ErinCoughlan commentedon Sep 14, 2016
@crisbeto I like the idea of allowing a function as well as assuming the 'px' if supplied a number. I think that can help prevent some user errors. Please file separate Issues for each of those bugs and we can tackle them to improve the datepicker.
[-]mdPanel: Rewrite mdDatepicker to use the panel.[/-][+]datePicker: use mdPanel container[/+]crisbeto commentedon Sep 18, 2016
@ErinCoughlan another one I ran into: at the moment, you can set the panel to close via clicking outside or pressing escape, however the datepicker also has the case where it closes the calendar if the user tabs away. Do you think it makes sense to have the "close on" keys configurable through
$mdPanelor just continue handling it within the calendar?ErinCoughlan commentedon Sep 18, 2016
@crisbeto I think tab makes a lot of sense. That's also used in popovers, basically if you tab past the end, focus leaves instead of being trapped.
I'm wondering two things in terms of use and API:
crisbeto commentedon Sep 18, 2016
feat(datepicker): migrate to mdPanel
feat(datepicker): migrate to mdPanel
feat(datepicker): migrate to mdPanel
11 remaining items
feat(datepicker): migrate to mdPanel
feat(datepicker): migrate to mdPanel
[-]datePicker: use mdPanel container[/-][+]datepicker: migrate to use mdPanel container[/+]