Use passive listener for link editor scrolling - #10610
sanjulaonline wants to merge 2 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe link editor now registers and removes its scroll listener with ChangesLink editor scroll handling
Suggested reviewers: Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error)
✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Hi @Mahima-Sanketh-Git, could you take a look at this one when you have a moment? This PR has no workflow runs — the only statuses are the CLA check and CodeRabbit, so the build and tests have never actually executed. Could you approve the workflow runs for it? It addresses wso2/product-is#27880 by making the link editor's Happy to make any changes you'd like. |
|
Looks good to me! Thanks for the fix. |
Purpose
Fix the React Doctor
client-passive-event-listenersfinding for the rich text link editor scroll listener.Root cause:
features/admin.flow-builder-core.v1/components/resource-property-panel/rich-text/helper-plugins/link-plugin.tsxregistered the bodyscrolllistener without{ passive: true }:The
updatecallback only reads the Lexical editor state and repositions the floating link editor. It does not accept the scroll event, does not callpreventDefault(), and does not need to block scrolling, so passive mode is safe.This PR adds a typed
AddEventListenerOptionsconstant withpassive: trueand uses it for bothaddEventListenerandremoveEventListener. Cleanup remains correct because listener removal matches by event type, callback, and capture value; using the same options object keeps the intent clear. The resize listener is unchanged.Patch changesets are included for
@wso2is/admin.flow-builder-core.v1and@wso2is/consoleper the repository changeset policy forfeatureschanges.Related Issues
Related PRs
Verification
pnpm dlx pnpm@10.33.0 --version- Passed, confirmed10.33.0.pnpm dlx pnpm@10.33.0 install- Passed.pnpm dlx pnpm@10.33.0 run build:modules- Passed..\node_modules\.bin\eslint.cmd features/admin.flow-builder-core.v1/components/resource-property-panel/rich-text/helper-plugins/link-plugin.tsx- Passed.git diff --check- Passed.origin/masterexact non-passive listener count:1.0.1.updatedoes not accept the scroll event and does not callpreventDefault(). ExistingpreventDefault()calls in the file are unrelated keyboard/click handlers.@wso2is/consolechangeset entry.Checks not completed locally
.github/workflows/react-doctor.yml, but no supported local command/script was found...\..\node_modules\.bin\tsc.cmd --noEmit --project tsconfig.json --pretty falsefromfeatures/admin.flow-builder-core.v1was attempted after dependency install and shared module build, but it fails on existing workspace package/type resolution errors such asCannot find module '@wso2is/react-components'andCannot find module '@wso2is/forms/legacy'outside this change..\node_modules\.bin\rollup.cmd --config rollup.config.cjsfromfeatures/admin.flow-builder-core.v1was attempted after dependency install and shared module build. It emitted the first bundle but failed while bundling declarations on existing generated declaration/style resolution, e.g.Could not resolve ./visual-flow.scss from dist/esm/types/components/visual-flow/visual-flow.d.ts.Checklist
Security checks
Developer Checklist (Mandatory)
product-isissue to track any behavioral change or migration impact.