Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

datepicker: migrate to use mdPanel container #9564

Open

Description

@ErinCoughlan

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.

Activity

  1. added
    in progress
    on Sep 13, 2016
  2. crisbeto commented on Sep 13, 2016

    @crisbeto
    Member

    @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:

    1. 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.
    2. 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) {
      return whateverOffsetShouldBeSet; // 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.

  3. ErinCoughlan commented on Sep 14, 2016

    @ErinCoughlan
    ContributorAuthor

    @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.

  4. changed the title [-]mdPanel: Rewrite mdDatepicker to use the panel.[/-] [+]datePicker: use mdPanel container[/+] on Sep 15, 2016
  5. crisbeto commented on Sep 18, 2016

    @crisbeto
    Member

    @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?

  6. ErinCoughlan commented on Sep 18, 2016

    @ErinCoughlan
    ContributorAuthor

    @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:

    1. 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.
    2. 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.
  7. crisbeto commented on Sep 18, 2016

    @crisbeto
    Member
    1. This might be tricky to get right on something as generic as the panel. That's why I'm on the fence on whether it makes sense.
    2. I can't think of any off the top of my head, apart from escape and tab.
  8. added a commit that references this issue on Sep 19, 2016
    102f0cf
  9. added
    has: Pull Request
    on Sep 19, 2016
  10. added 2 commits that reference this issue on Sep 19, 2016
    1bf91d5
    bf7a1b7
  11. 11 remaining items

  12. added 2 commits that reference this issue on Oct 26, 2016
    d998760
    91e5926
  13. modified the milestones: - Backlog, 1.2.0 on Feb 7, 2018
  14. added
    P2: required
    a11y
    on Feb 7, 2018
  15. added
    g3: reported
    on Jan 16, 2019
  16. changed the title [-]datePicker: use mdPanel container[/-] [+]datepicker: migrate to use mdPanel container[/+] on Feb 12, 2019
  17. added
    Blocked
    on Feb 12, 2019
  18. modified the milestones: 1.2.0, 1.3.0 on Jul 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BlockedP2: requireda11yg3: reportedhas: Pull Requestin progress

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions