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

[Feature] Get the row and column of the cells directly under the mouse based on the coordinates on the screen where the current mouse is located #1425

Closed
2 tasks done
iamyunsin opened this issue Feb 28, 2024 · 1 comment · Fixed by #2193
Assignees
Labels
feature request New feature or request scope:facade

Comments

@iamyunsin
Copy link

Initial checklist

  • Is this really a problem?
  • I have searched the Github Issues for similar issues, but did not find anything.

Problem

I hope to be able to set the corresponding selection based on the currently obtained rows and columns directly below the mouse, plus my own calculations. It may be multiple rows and columns, following the movement of the mouse.

Solution

step 1: Get the row and column of the cells directly under the mouse based on the coordinates on the screen where the current mouse is located.
step2: Calculate the selection range based on the cell row and column information obtained in the first step, and set the selection range to be displayed in the sheet.

@Dushusir
Copy link
Member

Dushusir commented May 8, 2024

Pay attention to the next version of Facade update. After getting the cell information through onCellPointerMove, you can perform customized operations.

univerAPI.getSheetHooks().onCellPointerMove((cell) => {
  // Get the cell currently pointed by the mouse
  console.log(cell);
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request scope:facade
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants