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

Unexpected positioning of Box object #88

Open
gormlabenz opened this issue Jul 28, 2023 · 0 comments
Open

Unexpected positioning of Box object #88

gormlabenz opened this issue Jul 28, 2023 · 0 comments

Comments

@gormlabenz
Copy link

Issue description:
When placing a Box object within a Flex object, unexpected positional values are observed. For flex-direction="column", the x position is 0.5 and for flex-direction="row", the y position is -0.5 when justifyContent="center" and alignItems="center" are applied. This is inconsistent with the expected values of 0.

Expected behavior:
The Box object, when placed inside a Flex object with justifyContent="center" and alignItems="center" applied, should result in x and y position values of 0.

Actual behavior:
The actual x position for flex-direction="column" is 0.5, and the y position for flex-direction="row" is -0.5.

Steps to reproduce:

  1. Create a Box object inside a Flex object.
  2. Apply justifyContent="center" and alignItems="center" to the Flex object.
  3. Log the x position value for flex-direction: column and y position value for flex-direction: row.

Minimal reproduction of the problem with instructions:
You can view and interact with a minimal reproduction of the issue here: https://stackblitz.com/edit/stackblitz-starters-n7vn5a?file=src%2FApp.tsx. In this example, clicking on the canvas will log the positional values.

Impact:
This issue is causing the Box object to not center properly within the Flex object and is also affecting the usage example in the documentation.

Additional notes:
Uncertain if this issue is a bug or a misunderstanding of the library's expected functionality. Any clarification or guidance would be highly appreciated.

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

No branches or pull requests

1 participant