fix(VP-2254): keep cursor visible over RTE links in Visual Builder#616
Merged
Conversation
…d patch npm audit vulnerabilities
🔒 Security Scan Results
⏱️ SLA Breach Summary
✅ BUILD PASSED - All security checks passed |
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes cursor disappearing when hovering links inside Rich Text Editors in Visual Builder (SF 00059859, reported by AIRBNB).
Root cause
In
mouseHover.ts, on every hover the SDK randocument.elementFromPointand, if the element under the pointer was an<a>/<button>, addedvisual-builder__no-cursor-style(cursor: none !important) to it — to suppress the native cursor while the custom cursor floats. That class was added but never removed. Once a link was hovered,cursor: nonestuck; when the RTE was selected/editable (custom cursor hidden), the link keptcursor: noneand the cursor vanished. Reproduces only inside full Visual Builder (needs the custom cursor), hence prod-only.Fix (diff)
mouseHover.ts: removed theelementFromPointblock that tagged links/buttons withno-cursor-style.visualBuilder.style.ts: extended the existing body-levelvisual-builder__default-cursor--disabledclass (already toggled on show/hide of the custom cursor) to also cover& a, & button; removed the now-unusedno-cursor-styleclass.Links now follow the body class via the CSS cascade and revert automatically when it is removed — no per-element mutation, so the leak is gone by construction.
Also included
overrides, no forced bumps.startEditingButton.test.tsx: madewindow.locationredefinesconfigurableand switchedfireEvent.focustobutton.focus()(synthetic focus no longer triggers Preact'sonFocusunder vitest 4).Testing
npm test: 861/861 pass on vitest 4.npm audit: 0 vulnerabilities.