Skip to content

Commit c56b17d

Browse files
committed
fix
1 parent 5930f1a commit c56b17d

File tree

4 files changed

+20
-13
lines changed

4 files changed

+20
-13
lines changed

packages/storybook/src/stories/drawer.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export const BasicExample = meta.story({
2323
},
2424
render: (args) => (
2525
<div>
26-
<p>some content within the page</p>
26+
<p>some content within the page. Make sure the Drawer is placed in the root.</p>
2727
<ScoutDrawer {...args}>
2828
<p>Content inside the drawer</p>
2929
</ScoutDrawer>

packages/ui-webc/src/components/drawer/drawer.css

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
.drawer {
2+
width: 100%;
3+
}
4+
/**
5+
* Mobile style
6+
*/
17
.drawer--container {
28
position: fixed;
39
bottom: 0;
@@ -33,13 +39,15 @@
3339
}
3440

3541
.open {
36-
animation: drawerOpen 0.3s ease-out forwards;
42+
animation: drawerOpen 0.3s ease-in-out forwards;
3743
}
3844
.close {
39-
animation: drawerClose 0.3s ease-out forwards;
45+
animation: drawerClose 0.3s ease-in-out forwards;
4046
}
4147

42-
/* Desktop drawer style */
48+
/**
49+
* Desktop style
50+
*/
4351
@media screen and (min-width: 901px) {
4452
@keyframes drawerOpen {
4553
from {
@@ -66,17 +74,18 @@
6674
height: 100%;
6775
max-height: 100%;
6876
max-width: 90%;
77+
min-height: 600px;
6978
width: 430px;
7079
transform: translateX(100%);
7180
border-top-left-radius: var(--spacing-5);
7281
border-bottom-left-radius: var(--spacing-5);
7382
border-top-right-radius: 0;
7483
}
7584
.open {
76-
animation: drawerOpen 0.3s ease-out forwards;
85+
animation: drawerOpen 0.3s ease-in-out forwards;
7786
}
7887
.close {
79-
animation: drawerClose 0.3s ease-out forwards;
88+
animation: drawerClose 0.3s ease-in-out forwards;
8089
}
8190
}
8291

packages/ui-webc/src/components/drawer/drawer.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,7 @@ export class ScoutDrawer implements ComponentInterface {
6565
componentWillLoad(): Promise<void> | void {
6666
this.focusedNode = document.activeElement;
6767
}
68-
componentDidLoad(): void {
69-
this.setDrawerOpenState(true);
70-
}
68+
7169
disconnectedCallback(): void {
7270
this.focusedNode;
7371
}

packages/ui-webc/src/components/drawer/readme.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
| Property | Attribute | Description | Type | Default |
99
| ----------------------- | ------------------------- | ------------------------------------------------------------------------------------------------------ | --------- | ------- |
1010
| `backButtonLabel` | `back-button-label` | Back button label. | `string` | `""` |
11-
| `disableBackdrop` | `disable-backdrop` | Disable backdrop for the drawer. Will also make it clickable to close the drawer. | `boolean` | `false` |
11+
| `disableBackdrop` | `disable-backdrop` | Disable backdrop for the drawer. | `boolean` | `false` |
1212
| `disableContentPadding` | `disable-content-padding` | Disable drawer content padding. Use only if you have specific use case and you need to use full width. | `boolean` | `false` |
13-
| `exitButtonLabel` | `exit-button-label` | Back button label. | `string` | `""` |
14-
| `heading` | `heading` | Open/close state of the drawer. | `string` | `""` |
15-
| `open` | `open` | Open/closestate of the drawer. | `boolean` | `false` |
13+
| `exitButtonLabel` | `exit-button-label` | Exit button label. | `string` | `""` |
14+
| `heading` | `heading` | Heading within the sheet. | `string` | `""` |
15+
| `open` | `open` | Open/close state of the drawer. | `boolean` | `false` |
1616
| `showBackButton` | `show-back-button` | Render back button. | `boolean` | `false` |
1717
| `showExitButton` | `show-exit-button` | Render exit button. | `boolean` | `false` |
1818

0 commit comments

Comments
 (0)