Skip to content

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

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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
Contributor

@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
Contributor

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.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants