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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

isActive() on the useSelections api is not set to false when clearing selections in the toolbar #576

Open
haxxmaxx opened this issue Feb 17, 2021 · 4 comments

Comments

@haxxmaxx
Copy link
Collaborator

馃悰 Bug report

When calling isActive() on the useSelections api after clearing selections in the toolbar, it returns true. This works if I run the same chart in sense.

Steps to Reproduce

  1. Make selections in some chart
  2. Clear using the toolbar
  3. Call isActive -> returns true

Expected behavior

Should always return false when no active selections, as in sense.

Actual behavior

Returns true even though selections are cleared and canceled

Versions

  • nebula.js: 1.1.0
  • Platform: osx
  • Browser: chrome

Additional context

Illustrated in the gif: When you press a cell, isActive is called. The first time when no selections are made, it returns false. The second time it is still true.

Kapture 2021-02-17 at 16 19 03

@Caele
Copy link
Collaborator

Caele commented Feb 18, 2021

The useObjectSelections object can't currently listen to the modal state change so it can't set its internal isActive property. isModal is a better check but is currently unavailable in the client. We'll look at sorting this out, but in the meantime we can avoid relying on these specifically.

@T-Wizard
Copy link
Collaborator

T-Wizard commented Feb 18, 2021

@haxxmaxx does it work if you use isActive indirect.
by storing the value in a useState and update it on the 'activated' and 'deactivated' events

@haxxmaxx
Copy link
Collaborator Author

Haven't tried, worth a shot. I'll try it

@haxxmaxx
Copy link
Collaborator Author

Yup that works

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

3 participants