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

Grid: Don't highlight grid cell if block being dragged is not allowed to be placed into the Grid #63979

Closed
Tracked by #57478
noisysocks opened this issue Jul 26, 2024 · 2 comments · Fixed by #64290
Closed
Tracked by #57478
Assignees
Labels
[Feature] Layout Layout block support, its UI controls, and style output. [Status] In Progress Tracking issues with work in progress [Type] Task Issues or PRs that have been broken down into an individual action to take

Comments

@noisysocks
Copy link
Member

noisysocks commented Jul 26, 2024

When you drag a block over a Grid, we highlight the cell that you're hovering over.

We should not do this when the block you're dragging can't be inserted into a Grid. For example, you can't put a Button block into a Grid. (You can only put a Button block into a Buttons block.)

Example:

Kapture.2024-07-26.at.15.12.27.mp4

The empty cells shouldn't turn blue.

I believe there's already selectors for this e.g. canInsertBlockType.

@noisysocks noisysocks changed the title Bug: Don't highlight grid cells if block being dragged can't be dropped (e.g. a Button block) Grid: Don't highlight grid cell if block being dragged is not allowed to be placed into the Grid Jul 26, 2024
@noisysocks noisysocks added [Type] Task Issues or PRs that have been broken down into an individual action to take [Feature] Layout Layout block support, its UI controls, and style output. labels Jul 26, 2024
@hanneslsm
Copy link

hanneslsm commented Jul 26, 2024

For example, you can't put a Button block into a Grid. (You can only put a Button block into a Buttons block.)

Regarding this example, wouldn't it be better to automatically create a the button group (or duplicate it with all settings) where the dragged button lives in?
Other than that, I agree that the empty cell shouldn't be blue.

@noisysocks
Copy link
Member Author

That's a good suggestion. I think if we did that then we should do it across all blocks. For now, in the context of #57478, all I really care about is refining Grid specifically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Layout Layout block support, its UI controls, and style output. [Status] In Progress Tracking issues with work in progress [Type] Task Issues or PRs that have been broken down into an individual action to take
Projects
None yet
3 participants