Skip to content
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

[BUG] Incorrect default flex direction in Flex component #120

Open
synuns opened this issue Jan 28, 2025 · 0 comments
Open

[BUG] Incorrect default flex direction in Flex component #120

synuns opened this issue Jan 28, 2025 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@synuns
Copy link
Member

synuns commented Jan 28, 2025

Bug Description

The Flex component's default direction prop is not properly set to 'row', causing unexpected layout behavior. The current implementation shows incorrect flex direction when no direction prop is provided.

Steps to Reproduce

Context: Using the Flex component in a story without specifying the direction prop

Actual Result

When no direction prop is provided, the flex direction is not defaulting to 'row' as expected, despite the CSS specification that 'row' should be the default flex direction.

Expected Result

The Flex component should:

  • Default to 'row' direction when no direction prop is provided
  • Maintain consistent behavior with standard CSS flex container defaults
  • Properly display child elements in a horizontal layout by default

Screenshots and Logs

Image
export const Justify: Story = {
  render: () => (
    <Flex direction="column" gap="2rem">
      <Flex justify="flex-start" gap="1rem">
        <Box style={{ minWidth: '150px', height: '30px' }} />
        <Box style={{ minWidth: '150px', height: '30px' }}>flex-start</Box>
        <Box style={{ minWidth: '150px', height: '30px' }} />
      </Flex>
      <Flex justify="center" gap="1rem">
        <Box style={{ width: '150px', height: '30px' }} />
        <Box style={{ width: '150px', height: '30px' }}>center</Box>
        <Box style={{ width: '150px', height: '30px' }} />
      </Flex>
      <Flex justify="flex-end" gap="1rem">
        <Box style={{ width: '150px', height: '30px' }} />
        <Box style={{ width: '150px', height: '30px' }}>flex-end</Box>
        <Box style={{ width: '150px', height: '30px' }} />
      </Flex>
      <Flex justify="space-between" gap="1rem">
        <Box style={{ width: '150px', height: '30px' }} />
        <Box style={{ width: '150px', height: '30px' }}>space-between</Box>
        <Box style={{ width: '150px', height: '30px' }} />
      </Flex>
      <Flex justify="space-around" gap="1rem">
        <Box style={{ width: '150px', height: '30px' }} />
        <Box style={{ width: '150px', height: '30px' }}>space-around</Box>
        <Box style={{ width: '150px', height: '30px' }} />
      </Flex>
      <Flex justify="space-evenly" gap="1rem">
        <Box style={{ width: '150px', height: '30px' }} />
        <Box style={{ width: '150px', height: '30px' }}>space-evenly</Box>
        <Box style={{ width: '150px', height: '30px' }} />
      </Flex>
    </Flex>
  ),
};
@synuns synuns added the bug Something isn't working label Jan 28, 2025
@synuns synuns self-assigned this Jan 28, 2025
synuns added a commit that referenced this issue Jan 28, 2025
- Add default flex direction in FlexProps interface
- Ensure consistent flex direction behavior
- Update CSS variable handling for flex direction
- Match standard CSS flex container behavior

BREAKING CHANGE: Set explicit default flex direction as 'row'
[BUG] Incorrect default flex direction in Flex component #120
synuns added a commit that referenced this issue Jan 28, 2025
- test default flex css properties
[BUG] Incorrect default flex direction in Flex component #120
synuns added a commit that referenced this issue Jan 28, 2025
- Add internal Box component for layout visualization in stories
- Remove unused @sipe-team/card dependency

[BUG] Incorrect default flex direction in Flex component #120
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant