Skip to content

fix(VE-5061): add observer to observe cslp of selected element - #356

Merged
srinad007 merged 3 commits into
develop_v3from
VE-5061
Feb 18, 2025
Merged

fix(VE-5061): add observer to observe cslp of selected element#356
srinad007 merged 3 commits into
develop_v3from
VE-5061

Conversation

@srinad007

Copy link
Copy Markdown
Contributor

Title: Added focus element observer to observe the focused element's data-cslp attribute and re-evaluate handleBuilderInteraction every time it changes.

Summary: This PR introduces a MutationObserver to monitor changes to the data-cslp attribute of the focused element. When the data-cslp attribute changes, the handleBuilderInteraction function is re-evaluated to ensure the focussed Toolbar update

Changes:

Added a MutationObserver to the handleBuilderInteraction function.
The observer watches for changes to the data-cslp attribute of the focused element.
When a change is detected, the observer disconnects itself and re-calls handleBuilderInteraction with the reEvaluate parameter set to true.
The observer is stored in the global state and properly disconnected when no longer needed.

@srinad007
srinad007 requested a review from a team as a code owner February 14, 2025 10:13
@srinad007
srinad007 requested review from faraazb, hiteshshetty-dev and sairajchouhan and removed request for a team February 14, 2025 10:13
@github-actions

github-actions Bot commented Feb 14, 2025

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 80.52% 6582 / 8174
🔵 Statements 80.52% 6582 / 8174
🔵 Functions 74.92% 239 / 319
🔵 Branches 84.4% 790 / 936
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/visualBuilder/index.ts 60.54% 84.61% 42.85% 60.54% 77-84, 87-88, 91-100, 103-176, 182-215
src/visualBuilder/generators/generateOverlay.tsx 94.02% 86.36% 100% 94.02% 128-137, 172
src/visualBuilder/listeners/mouseClick.ts 84.69% 84.84% 90.9% 84.69% 77-78, 107-108, 152, 209-215, 233-239, 259-269
Generated in workflow #240 for commit abf08bf by the Vitest Coverage Report Action

@faraazb faraazb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@faraazb faraazb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@srinad007
srinad007 merged commit d576d90 into develop_v3 Feb 18, 2025
@srinad007
srinad007 deleted the VE-5061 branch February 18, 2025 10:31
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.

2 participants