Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions pages/container/simple.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ export default function SimpleContainers() {
Content area takes the available vertical space
</Container>
</div>
<Container
disableContentPaddings={true}
Copy link
Member

Choose a reason for hiding this comment

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

this is not needed now

Copy link
Member Author

Choose a reason for hiding this comment

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

I would rather leave it here because without disableContentPaddings the border looks correct. It is to make sure the fix still works even with disableContentPaddings.

header={<Header variant="h2">Container Without Content</Header>}
></Container>
</SpaceBetween>
</ScreenshotArea>
</article>
Expand Down
1 change: 1 addition & 0 deletions src/container/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export default function Container({
disableContentPaddings={disableContentPaddings}
{...externalProps}
{...baseComponentProps}
__hiddenContent={!props.children}
Copy link
Member

Choose a reason for hiding this comment

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

Does this mean that all internal use of container remain unfixed? Why is that needed?

This fix should be applied to internal instances too

Copy link
Member

Choose a reason for hiding this comment

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

Basically, this line should become

[styles['with-hidden-content']]: !children || __hiddenContent

Copy link
Member Author

Choose a reason for hiding this comment

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

Hi Boris, thanks for checking it. I was not sure we should not use container without content internally at all, It should be either ExpandableSection or Header? But I agree it makes sense the fix should be for all cases.

Copy link
Member Author

Choose a reason for hiding this comment

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

fix in #669

/>
);
}
Expand Down