Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make grid rearrange work in grid components (#6589)
**Problem:** Grid rearrange does not work when the grid is a root element of a component. **Fix:** The problem is that we assume that the parent element of a grid item is the grid itself. However, when the grid is in a component, the parent element is the component instance, and not the grid element inside it. This is a problem because we can not find the grid measurement helper from the parent element path. The solution is that all necessary grid related measurement data should be available in the metadata of the grid items themselves. - Added new fields to specialSizeMeasurements about the parent grid - Rewrote grid rearrange strategies and helpers to rely on the specialSizeMeasurements of the item, and not of the parent. Still unsolved: - Grid strategies set the props of the grid controls (e.g. to show which is the highlighted cell). These still assume that the control is on the parent, which is true in cases when the grid is root element of a component. Solving the problem for more problematic cases is out of scope for this PR. **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
- Loading branch information