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

How to know which fortunesheet is currently focused #556

Open
subhajitnag28 opened this issue Jun 12, 2024 · 3 comments
Open

How to know which fortunesheet is currently focused #556

subhajitnag28 opened this issue Jun 12, 2024 · 3 comments

Comments

@subhajitnag28
Copy link

subhajitnag28 commented Jun 12, 2024

Hi @sanchit3008 can you please guide how to know which fortunesheet is currently focused if single or multiple fortunesheet we added and whichever fortunesheet we edited my focus should be updated to that fortuneshhet only ? and If we click outside of the fortunesheet how to removed the selection where my last cursor point was?

@subhajitnag28 subhajitnag28 changed the title Which fortunesheet is currently focused how to know it How to know which fortunesheet is currently focused Jun 12, 2024
@sanchit3008
Copy link
Collaborator

This is a good question, and I dont see a method to return the currently active sheet. I still need to play around a bit to see if this info is being returned by something else. Keeping this thread open.

For the second part, you can probably attach a click listener outside FS and then use the setSelection method

@subhajitnag28
Copy link
Author

subhajitnag28 commented Jun 12, 2024

Hi @sanchit3008 If we click outside of the fortunesheet how to removed the selection where my last cursor point was?

I attach a click listener outside FS and then use the setSelection method but I'm getting the below error

WhatsApp Image 2024-06-12 at 19 28 41

when there is one FS there is no issue with the error but if we are creating multiple FS, in the second FS onward I'm not able to update anything.

ref.current?.setSelection([ { row:[], column:[] } ]);

In the demo page of FS in the console I have seen the below error -

Screenshot 2024-06-12 at 7 36 07 PM

Can you please guide me.

@sanchit3008
Copy link
Collaborator

If I understand this correctly, you want to have multiple sheets on a page. When you click outside the sheet area you want the selection to be removed.

  1. Are you using multiple Workbook components or are you referring to multiple sheets in 1 workbook?
  2. When the user click the sheet component again, then what is the expectation?

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

No branches or pull requests

2 participants