Skip to content

Conversation

@YueyingLu
Copy link
Member

Description

When container has no content and disableContentPaddings, the bottom border radius are overlapped by header. The change adds border radius when no content in the container, as we did for collapsed ExpandableSection.
For test, add one more instance in simple.page, it will show in the screenshot tests.

Related links, issue AWSUI-20171

How has this been tested?

Review checklist

The following items are to be evaluated by the author(s) and the reviewer(s).

Correctness

  • Changes include appropriate documentation updates.
  • Changes are backward-compatible if not indicated, see CONTRIBUTING.md.
  • Changes do not include unsupported browser features, see CONTRIBUTING.md.
  • Changes were manually tested for accessibility, see accessibility guidelines.

Security

Testing

  • Changes are covered with new/existing unit tests?
  • Changes are covered with new/existing integration tests?

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@YueyingLu YueyingLu marked this pull request as ready for review January 24, 2023 10:04
@YueyingLu YueyingLu requested a review from a team as a code owner January 24, 2023 10:04
@YueyingLu YueyingLu requested review from abdhalees and removed request for a team January 24, 2023 10:04
disableContentPaddings={disableContentPaddings}
{...externalProps}
{...baseComponentProps}
__hiddenContent={disableContentPaddings && !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.

is disableContentPaddings necessary?
this should work regardless of padding, customers used this as a hack but I think it should work without it

Copy link
Member Author

Choose a reason for hiding this comment

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

Makes sense! Will update it.

@YueyingLu YueyingLu requested a review from abdhalees January 24, 2023 10:13
</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.

@codecov
Copy link

codecov bot commented Jan 24, 2023

Codecov Report

Base: 92.97% // Head: 92.98% // Increases project coverage by +0.00% 🎉

Coverage data is based on head (eb5ce15) compared to base (d52870f).
Patch has no changes to coverable lines.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #663   +/-   ##
=======================================
  Coverage   92.97%   92.98%           
=======================================
  Files         574      574           
  Lines       16766    16781   +15     
  Branches     4628     4631    +3     
=======================================
+ Hits        15588    15603   +15     
  Misses       1101     1101           
  Partials       77       77           
Impacted Files Coverage Δ
src/container/index.tsx 100.00% <ø> (ø)
src/input/index.tsx 100.00% <0.00%> (ø)
src/input/internal.tsx 100.00% <0.00%> (ø)
src/modal/internal.tsx 100.00% <0.00%> (ø)
src/tag-editor/index.tsx 90.81% <0.00%> (ø)
src/autosuggest/internal.tsx 95.23% <0.00%> (ø)
src/text-filter/internal.tsx 100.00% <0.00%> (ø)
src/property-filter/token-editor.tsx 98.13% <0.00%> (ø)
src/internal/components/tab-trap/index.tsx 100.00% <0.00%> (ø)
src/internal/hooks/use-merge-refs/index.tsx 100.00% <0.00%> (ø)
... and 6 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@YueyingLu YueyingLu requested a review from abdhalees January 24, 2023 10:28
@YueyingLu YueyingLu merged commit fdaa4a5 into main Jan 24, 2023
@YueyingLu YueyingLu deleted the container-without-content-borderradius branch January 24, 2023 13:54
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants