Skip to content

chore: Repro PR for Columns space issue #916

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
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
1 change: 1 addition & 0 deletions src/columns/columns.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ export function ResponsiveStory(args: PartialProps<typeof Columns>) {
</Columns>
</Wrapper>
<Wrapper title="Space between columns reduces on smaller screen sizes">
{/* Here is the "offending" space prop format 👇 */}
<Columns space={{ mobile: 'xsmall', tablet: 'medium', desktop: 'xlarge' }}>
{times(5).map((i) => (
<Column key={i}>
Expand Down
8 changes: 8 additions & 0 deletions src/columns/columns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,20 @@ const Columns = polymorphicComponent<'div', ColumnsProps>(function Columns(
},
ref,
) {
// Here I'm just printing out how the generated className looks like
// You can see that the fact that `space` is a composite type (i.e. mobile: '...', table: '...')
// triggers the issue
// Everything works fine if `space` is a simple string like 'medium' (not composite)
// eslint-disable-next-line no-console
console.log('className', getClassNames(styles, 'container', space))

return (
<Box
{...props}
className={[
exceptionallySetClassName,
styles.container,
// Here is where we actually call `getClassNames` 👇
getClassNames(styles, 'container', space),
]}
display="flex"
Expand Down