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

Visual 'selection' cannot be removed via API when staticState === true #365

Closed
techfg opened this issue Feb 7, 2021 · 0 comments · Fixed by #371
Closed

Visual 'selection' cannot be removed via API when staticState === true #365

techfg opened this issue Feb 7, 2021 · 0 comments · Fixed by #371
Labels
Milestone

Comments

@techfg
Copy link
Collaborator

techfg commented Feb 7, 2021

Describe the bug
Per the docs, invoking select/set API on an area will not honor staticState value. This is true when it comes to the 'selected' state of an area obtained via get API.

When staticState === true, calling get will not return the area unless select/set was called on that area to select it. Similarly, deslecting via select/set will result in the area no longer being returned from get.

However, when deselecting via select/set, the Area is still visually selected (e.g. fill/stroke/etc.) if the staticState === true.

Conversely, when staticState === false, API calls properly set get result AND update UI visually accordingly.

This inconsistency should be addressed and based on docs, the situation with staticState === true should be fixed to behave the same as staticState === false.

In short, the following fix should be made:

  1. When staticState is true
  2. If select/set has been called, visual & selected state (via get) should reflect the last value set via the API

To Reproduce
Steps to reproduce the behavior:

  1. Go to jsFiddle
  2. Click on "Select Paul" - selected keys include paul
  3. Click on "Deselect Paul" - Paul remains visibly selected but selected keys is empty
  4. Click on "Select Ringo" - selected keys include ringo & ringo is visually selected
  5. Click on "Deselect Ringo" - selected keys is empty & ringo is NOT visually selected

Expected behavior
When staticState === true, "UI representations of selected" should match API value set after the first time the API is used just as staticState === false does.

Screenshots
N/A

Desktop (please complete the following information):
N/A

Smartphone (please complete the following information):
N/A

Additional context
N/A

@techfg techfg added the bug label Feb 7, 2021
@techfg techfg added this to the 1.5.2 milestone Feb 7, 2021
techfg added a commit that referenced this issue Feb 14, 2021
@techfg techfg mentioned this issue Feb 14, 2021
techfg added a commit that referenced this issue Feb 14, 2021
Resolves #137 - fix handling of href attribute empty/missing
Resolves #170 - fix missing/non-conforming shape attribute
Resolves #364 - fix uncaught promise when mouseoutDelay -1
Resolves #365 - fix selected state when `staticState === true`
Resolves #366 - fix selected state when `staticState === false`
Resolves #367 - fix options not correctly applied when calling set/selected API
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant