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

Respect spans when resizing grid items #6683

Closed
ruggi opened this issue Nov 26, 2024 · 0 comments · Fixed by #6685
Closed

Respect spans when resizing grid items #6683

ruggi opened this issue Nov 26, 2024 · 0 comments · Fixed by #6685
Assignees

Comments

@ruggi
Copy link
Contributor

ruggi commented Nov 26, 2024

No description provided.

@ruggi ruggi self-assigned this Nov 26, 2024
ruggi added a commit that referenced this issue Nov 27, 2024
**Problem:**

Resizing grid cells always forces explicit numerical placement pins,
chomping any `span`s that may have been defined on the cell.

**Fix:**

After determining the right numerical positions for the resized cell
bounds, do a normalization pass so that the new grid props are rewritten
to respect the new bounds but also to express them with `spans` if the
original pins were spans in the first place.

For example, assuming enlarging to the right by 1 cell:

| Initial | Result |
|--------|----------|
| `gridColumn: span 2` | `gridColumn: span 3` |
| `gridColumn 3 / span 2` | `gridColumn: 3 / span 3` |

**Manual Tests:**
I hereby swear that:

- [x] I opened a hydrogen project and it loaded
- [x] I could navigate to various routes in Play mode

Fixes #6683
liady pushed a commit that referenced this issue Dec 13, 2024
**Problem:**

Resizing grid cells always forces explicit numerical placement pins,
chomping any `span`s that may have been defined on the cell.

**Fix:**

After determining the right numerical positions for the resized cell
bounds, do a normalization pass so that the new grid props are rewritten
to respect the new bounds but also to express them with `spans` if the
original pins were spans in the first place.

For example, assuming enlarging to the right by 1 cell:

| Initial | Result |
|--------|----------|
| `gridColumn: span 2` | `gridColumn: span 3` |
| `gridColumn 3 / span 2` | `gridColumn: 3 / span 3` |

**Manual Tests:**
I hereby swear that:

- [x] I opened a hydrogen project and it loaded
- [x] I could navigate to various routes in Play mode

Fixes #6683
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 a pull request may close this issue.

1 participant