-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
fix(drawer): allow drawer below top app bar #4028
Conversation
packages/mdc-drawer/README.md
Outdated
@@ -160,6 +160,62 @@ Drawers can contain a header element which will not scroll with the rest of the | |||
</aside> | |||
``` | |||
|
|||
### Drawer Below Top App Bar |
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.
Can we remove this section and keep the one in Usage with Top App Bar
section?
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.
This is the permanent below top app bar...it is slightly different. Do you still wanna remove 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.
Let's keep just one example for Dismissible drawer variant to avoid maintaining two different variations of this version.
test/screenshot/golden.json
Outdated
@@ -556,6 +556,14 @@ | |||
"desktop_windows_ie@11": "https://storage.googleapis.com/mdc-web-screenshot-tests/advorak/2018/09/21/16_50_45_748/spec/mdc-dialog/mixins/title-ink-color.html.windows_ie_11.png" | |||
} | |||
}, | |||
"spec/mdc-drawer/classes/dismissible-below-top-app-bar.html": { | |||
"public_url": "https://storage.googleapis.com/mdc-web-screenshot-tests/travis/2018/10/31/20_39_25_363/spec/mdc-drawer/classes/dismissible-below-top-app-bar.html?utm_source=golden_json", |
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.
Seems like the main content is not scrollable in this demo. Also the drawer is being clipped at the bottom when I resize the browser small viewport.
We need to update the docs too to layout main content and drawer correctly.
packages/mdc-drawer/README.md
Outdated
@@ -160,6 +160,62 @@ Drawers can contain a header element which will not scroll with the rest of the | |||
</aside> | |||
``` | |||
|
|||
### Drawer Below Top App Bar |
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.
Let's keep just one example for Dismissible drawer variant to avoid maintaining two different variations of this version.
packages/mdc-drawer/README.md
Outdated
@@ -263,7 +365,6 @@ body { | |||
.app-bar { | |||
position: absolute; | |||
} | |||
``` |
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.
Revert this line.
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 don't see this change updated. This breaks the formatting.
packages/mdc-drawer/README.md
Outdated
```scss | ||
// Note: these styles do not account for any paddings/margins that you may need. | ||
|
||
.below-top-app-bar-container { |
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'm sure we need more additional styles than these to get correct layout for this variant. The z-index of app-bar need to be updated to stay on top of drawer. --fixed-adjust
needs to be applied to drawer root and app-content individually. Also the main content should be scrollable.
Please take a look at this example:
https://stackblitz.com/edit/mdc-drawer-demo-fiqbfg?file=index.scss
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.
Not sure what you mean. It looks like both areas independently scroll from each other.
@@ -556,6 +556,14 @@ | |||
"desktop_windows_ie@11": "https://storage.googleapis.com/mdc-web-screenshot-tests/advorak/2018/09/21/16_50_45_748/spec/mdc-dialog/mixins/title-ink-color.html.windows_ie_11.png" | |||
} | |||
}, | |||
"spec/mdc-drawer/classes/dismissible-below-top-app-bar.html": { |
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.
Thanks for adding screenshot test 🎉
packages/mdc-drawer/README.md
Outdated
The CSS to match it looks like this: | ||
##### Dismissible Drawer Below Top App Bar | ||
|
||
In cases where the drawer appears below the top app bar you will want to follow the markup shown below. The `mdc-drawer__content` and `main-content` elements will also scroll independently of each other. The `mdc-top-app-bar` and `mdc-top-app-bar--fixed-adjust` will be sit sibling to each other. The `mdc-top-app-bar--fixed-adjust` element will contain the `mdc-drawer--dismissible` and `mdc-drawer-app-content` elements. |
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.
"The mdc-top-app-bar
, mdc-drawer
and mdc-drawer-app-content
will be sibling to each other. The mdc-top-app-bar--fixed-adjust
helper class will be applied to mdc-drawer
and mdc-drawer-app-content
elements to adjust the position with top app bar."
packages/mdc-drawer/README.md
Outdated
@@ -263,7 +365,6 @@ body { | |||
.app-bar { | |||
position: absolute; | |||
} | |||
``` |
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 don't see this change updated. This breaks the formatting.
@@ -0,0 +1,233 @@ | |||
<!DOCTYPE html> |
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.
We might not need to screenshot test this. Dismissible & permanent drawers have exact same styles except the JS logic.
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.
true - i'll remove
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.
Please update golden.json file.
test/screenshot/golden.json
Outdated
@@ -574,6 +582,14 @@ | |||
"desktop_windows_ie@11": "https://storage.googleapis.com/mdc-web-screenshot-tests/advorak/2018/09/26/06_08_27_877/spec/mdc-drawer/classes/modal.html.windows_ie_11.png" | |||
} | |||
}, | |||
"spec/mdc-drawer/classes/permanant-below-top-app-bar.html": { |
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.
Since you've removed this from screenshot tests, remove these from golden.json too.
test/screenshot/golden.json
Outdated
@@ -556,6 +556,14 @@ | |||
"desktop_windows_ie@11": "https://storage.googleapis.com/mdc-web-screenshot-tests/advorak/2018/09/21/16_50_45_748/spec/mdc-dialog/mixins/title-ink-color.html.windows_ie_11.png" | |||
} | |||
}, | |||
"spec/mdc-drawer/classes/dismissible-below-top-app-bar.html": { | |||
"public_url": "https://storage.googleapis.com/mdc-web-screenshot-tests/travis/2018/10/31/20_39_25_363/spec/mdc-drawer/classes/dismissible-below-top-app-bar.html?utm_source=golden_json", |
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.
Update golden.json with latest changes.
…mponents/material-components-web into fix/drawer/below-top-app-bar
…mponents/material-components-web into fix/drawer/below-top-app-bart
🤖 Beep boop! Screenshot test report 🚦6 screenshots changed from Details |
(cherry picked from commit ebdb084)
related material-components/material-components-web-react#377
top
css property from dismissible drawer class