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

feat: add keyboard shortcuts to add rows and columns on grid cell hover #76

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

leandroercoli
Copy link
Contributor

In addition to add rows and columns on current area with keys c and r:

  • Add row on current area under grid cell hovered + r
  • Add column on current area to the right of grid cell hovered + c

The columns and rows added will move inner children to the right/bottom if needed.

Copy link
Member

@patak-dev patak-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great! Thanks a lot for this PR ❤️
We need some small changes, and then we are good to go

@@ -354,6 +355,15 @@ function onOverCell({ row, col }) {
overArea.value = props.area
}

function onOverGridCell({ row, col }) {
onOverCell({ row, col })
if (overArea.value.display === 'grid') overArea.value.grid.hover = { row, col }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should change this to be something like overArea: { area, cell: { row, coll } }. If you check the other hover or focused states, they don't modify the design state because that is included in undo/redo automatically. So all this focus info needs to be out of the mainArea state tree.

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 this pull request may close these issues.

2 participants