Skip to content

Commit

Permalink
BannerSlim: fix bug with list of children (#3948)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlbertCarreras authored Jan 16, 2025
1 parent c2821d3 commit 165636f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 22 deletions.
10 changes: 6 additions & 4 deletions packages/gestalt/src/BannerSlim.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -264,10 +264,12 @@ export default function BannerSlim({
</Text>
</Fragment>
) : null}
<Fragment>
<Text ref={referenceRef} inline />
{typeof message !== 'string' && cloneElement(message, { ref: targetRef })}
</Fragment>
{message && typeof message !== 'string' ? (
<Fragment>
<Text ref={referenceRef} inline />
{cloneElement(message, { ref: targetRef })}
</Fragment>
) : null}
</Box>
</Flex.Item>

Expand Down
15 changes: 0 additions & 15 deletions packages/gestalt/src/__snapshots__/BannerSlim.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@ exports[`BannerSlim renders an icon with accessibility label 1`] = `
>
test
</span>
<span
className="default alignStart breakWord Text fontSize300 fontWeightNormal"
/>
</div>
</div>
</div>
Expand Down Expand Up @@ -159,9 +156,6 @@ exports[`BannerSlim renders neutral type with message 1`] = `
>
test
</span>
<span
className="default alignStart breakWord Text fontSize300 fontWeightNormal"
/>
</div>
</div>
</div>
Expand Down Expand Up @@ -221,9 +215,6 @@ exports[`BannerSlim renders non-neutral compact with accessibility label 1`] = `
>
test
</span>
<span
className="default alignStart breakWord Text fontSize300 fontWeightNormal"
/>
</div>
</div>
</div>
Expand Down Expand Up @@ -261,9 +252,6 @@ exports[`BannerSlim renders primary action and dismiss button 1`] = `
>
test
</span>
<span
className="default alignStart breakWord Text fontSize300 fontWeightNormal"
/>
</div>
</div>
<div
Expand Down Expand Up @@ -445,9 +433,6 @@ exports[`BannerSlim renders simple message with helper link 1`] = `
</a>
</span>
</span>
<span
className="default alignStart breakWord Text fontSize300 fontWeightNormal"
/>
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,6 @@ exports[`renders correctly with drawer 1`] = `
>
Test BannerSlim
</span>
<span
className="default alignStart breakWord Text fontSize300 fontWeightNormal"
/>
</div>
</div>
</div>
Expand Down

0 comments on commit 165636f

Please sign in to comment.