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

fix(ui/side_panel) biome linter broke drag end handler #527

Merged
merged 2 commits into from
Feb 8, 2024

Conversation

chrisj
Copy link
Contributor

@chrisj chrisj commented Feb 7, 2024

  ✖ Avoid the delete operator which can impact performance.
  
    282 │   endDrag() {
  > 283 │     delete this.element.dataset.neuroglancerSidePanelDrag;
        │     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    284 │     this.dragSource = undefined;
    285 │   }
  
  ℹ Unsafe fix: Use an undefined assignment instead.
  
    281 281 │   
    282 282 │     endDrag() {
    283     │ - ····delete·this.element.dataset.neuroglancerSidePanelDrag;
        283 │ + ····this.element.dataset.neuroglancerSidePanelDrag·=·undefined;
    284 284 │       this.dragSource = undefined;
    285 285 │     }

Using undefined causes the data attribute to remain as data-neuroglancer-side-panel-drag="undefined" which still triggers the [data-neuroglancer-side-panel-drag] css property which makes the neuroglancer-side-panel-drop-zone block pointer events.

I created an issue on biome biomejs/biome#1765 We could disable noDelete for now or change the code to this.element.removeAttribute('data-neuroglancer-side-panel-drag');

Side note, I added a comment to my AnnotationLayerView PR that might have been unnoticed (in code comment thread) #504 (comment)

@jbms
Copy link
Collaborator

jbms commented Feb 7, 2024

Thanks for catching this --- please just disable this lint in biome.json. Given the large number of lint fixes I failed to adequately check them all.

@chrisj
Copy link
Contributor Author

chrisj commented Feb 7, 2024

Done

@jbms jbms merged commit 405557f into google:master Feb 8, 2024
11 of 20 checks passed
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

Successfully merging this pull request may close these issues.

None yet

2 participants