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

feat(panel): allow transform to be animated on an offset panel #11390

Merged
merged 2 commits into from
Jun 17, 2020

Conversation

Splaktar
Copy link
Member

@Splaktar Splaktar commented Jul 31, 2018

PR Checklist

Please check that your PR fulfills the following requirements:

  • The commit message follows our guidelines
  • Tests for the changes have been added or this is not a bug fix / enhancement
  • Docs have been added, updated, or were not required

PR Type

What kind of change does this PR introduce?

[x] Bugfix
[x] Enhancement
[ ] Documentation content changes
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Infrastructure changes
[ ] Other... Please describe:

What is the current behavior?

Previously, if a panel had a position with an offset (e.g. $mdPanel.newPanelPosition().center()), the positioning would break any transform animations on the panel. This was due to the fact that mdPanel uses inline transform styles to do the offsetting.

Issue Number:
Relates to #9641.
Fixes #9905.

What is the new behavior?

These changes introduce a wrapper around the panel (.md-panel-inner-wrapper), which will handle all of the positioning, allowing for any animations to be applied to the .md-panel itself.

Does this PR introduce a breaking change?

[ ] Yes
[ ] No

Other information

Moving this over from #9941 so that rebasing can happen and some additional clean up can be completed. This already went through a couple rounds of reviews in that PR.

TODO

  • Fix tooltips are no longer styled properly with these changes
  • Do some more manual testing
  • Review for breaking changes

@googlebot
Copy link

So there's good news and bad news.

👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there.

😕 The bad news is that it appears that one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request.

Note to project maintainer: This is a terminal state, meaning the cla/google commit status will not change from this state. It's up to you to confirm consent of the commit author(s) and merge this pull request when appropriate.

@googlebot googlebot added the cla: no PR author needs to sign Google's CLA: https://opensource.google.com/docs/cla/ label Jul 31, 2018
@Splaktar Splaktar added this to the 1.1.11 milestone Jul 31, 2018
@Splaktar Splaktar added in progress Mainly for in progress PRs, but may be used for issues that require multiple PRs type: enhancement ux: polish P2: required Issues that must be fixed. ui: CSS hotlist: animations labels Jul 31, 2018
@Splaktar
Copy link
Member Author

@crisbeto can you please confirm to make @googlebot happy?

@Splaktar Splaktar added needs: manual testing This issue or PR needs to have some manual testing and verification done needs: review This PR is waiting on review from the team labels Jul 31, 2018
@crisbeto
Copy link
Member

I don't think it's down to confirmation, but rather that there are two people on the commit.

@Splaktar
Copy link
Member Author

Splaktar commented Aug 1, 2018

@crisbeto right, that causes the warning. Part of the process is just for you to post here

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request.

When the Googler goes to merge this, they just need to check that you are OK with your commits being checked into the project. I'm sure that's not a problem in this case 😁

@crisbeto
Copy link
Member

crisbeto commented Aug 1, 2018

I signed it!

@Splaktar Splaktar modified the milestones: 1.1.11, 1.1.12 Sep 24, 2018
@Splaktar Splaktar modified the milestones: 1.1.12, 1.1.13 Jan 3, 2019
@Splaktar Splaktar modified the milestones: 1.1.13, 1.1.14 Feb 10, 2019
@Splaktar Splaktar self-assigned this Feb 10, 2019
@Splaktar Splaktar added the g3: reported The issue was reported by an internal or external product team. label Feb 12, 2019
@Splaktar Splaktar modified the milestones: 1.1.14, 1.1.15 Mar 14, 2019
@Splaktar Splaktar modified the milestones: 1.1.15, 1.1.16, 1.1.18, 1.1.19 Mar 29, 2019
@Splaktar Splaktar removed the needs: review This PR is waiting on review from the team label Mar 6, 2020
@Splaktar Splaktar force-pushed the panel-offset-animation branch from 93d6572 to 7ef555e Compare May 15, 2020 19:39
Copy link
Member

@crisbeto crisbeto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

src/components/panel/panel.scss Show resolved Hide resolved
Previously, if a panel had a position with an offset (e.g. `$mdPanel.newPanelPosition().center()`), the positioning would break any `transform` animations on the panel. This was due to the fact that `mdPanel` uses inline `transform` styles to do the offsetting. These changes introduce a wrapper around the panel (`.md-panel-inner-wrapper`), which will handle all of the positioning, allowing for any animations to be applied to the `.md-panel` itself.

Relates to #9641.
Fixes #9905.
@Splaktar Splaktar removed - Breaking Change in progress Mainly for in progress PRs, but may be used for issues that require multiple PRs needs: manual testing This issue or PR needs to have some manual testing and verification done labels Jun 16, 2020
…nel change

- `md-panel` changed from `position: fixed` to `relative`
  - that resulted in the tooltip's `height` style not having any effect
@Splaktar Splaktar force-pushed the panel-offset-animation branch from 7ef555e to da05a55 Compare June 16, 2020 03:12
@Splaktar Splaktar added the pr: merge ready This PR is ready for a caretaker to review label Jun 16, 2020
@Splaktar Splaktar requested a review from mmalerba June 16, 2020 03:17
Copy link
Contributor

@mmalerba mmalerba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Splaktar Splaktar added the pr: lgtm This PR has been approved by the reviewer label Jun 17, 2020
@Splaktar Splaktar merged commit 20194ba into master Jun 17, 2020
@Splaktar Splaktar deleted the panel-offset-animation branch June 17, 2020 04:34
@@ -1321,26 +1321,32 @@ MdPanelService.prototype._wrapTemplate = function(origTemplate) {
// height and width for positioning.
return '' +
'<div class="md-panel-outer-wrapper">' +
' <div class="md-panel _md-panel-offscreen">' + template + '</div>' +
'<div class="md-panel-inner-wrapper" style="left: -9999px;">' +
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This inline style (style="left: -9999px;") triggers a CSP violation for unsafe-inline.

var wrapper = angular.element('<div class="md-panel-outer-wrapper">');
var outerWrapper = angular.element(
'<div class="md-panel-outer-wrapper">' +
'<div class="md-panel-inner-wrapper" style="left: -9999px;"></div>' +
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This inline style (style="left: -9999px;") triggers a CSP violation for unsafe-inline.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: no PR author needs to sign Google's CLA: https://opensource.google.com/docs/cla/ g3: reported The issue was reported by an internal or external product team. hotlist: animations P2: required Issues that must be fixed. pr: lgtm This PR has been approved by the reviewer pr: merge ready This PR is ready for a caretaker to review type: enhancement ui: CSS ux: polish
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat(panel): allow transform to be animated on elements with an offset
4 participants