-
Notifications
You must be signed in to change notification settings - Fork 76
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
[Action-Pad] potentially unused mutation observer #10353
Comments
Seems like it should be used in order to update newly slotted |
Looks like popover has the same issue: calcite-design-system/packages/calcite-components/src/components/popover/popover.tsx Line 252 in 4160af1
|
I think we need an eslint rule to make sure mutation observers are observed and disconnected within a file :) cc @jcfranco |
It might be better to just create a controller for that - the controller will take care of observing connected/disconnect. Controllers would simplify a lot of boilerplate you are having - connectMessages, connectLocalized, setComponentLoaded, etc - all of that will go away |
Installed and assigned for verification. |
**Related Issue:** #10353 ## Summary - connect and disconnect mutation observer
🍠 Verified locally on |
Check existing issues
Actual Behavior
Action-pad component creates a mutation observer:
https://github.com/Esri/calcite-design-system/blob/6f42a868f5cc65ae8a7c89f22ad9057b90fe4bca/packages/calcite-components/src/components/action-pad/action-pad.tsx#L152C3-L154
However once created, that observer is not used -
observer()
orunobserve()
is never called on it.If I am reading the code right, this observer has no effect.
Expected Behavior
Either observer is supposed to be used, and it's a bug that it's not used, or it should be removed as dead code.
For an example of mutation observer being used, see how it's used in Action:
calcite-design-system/packages/calcite-components/src/components/action/action.tsx
Line 177 in 6f42a86
calcite-design-system/packages/calcite-components/src/components/action/action.tsx
Line 194 in 6f42a86
Reproduction Sample
Reproduction Steps
Reproduction Version
v2.12.2
Relevant Info
No response
Regression?
No response
Priority impact
impact - p3 - not time sensitive
Impact
No response
Calcite package
Esri team
ArcGIS Maps SDK for JavaScript
The text was updated successfully, but these errors were encountered: