| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Fix issue where the `this` reference in the double-click handler callback was incorrectly bound to the graph instance instead of the editor instance, breaking compatibility with mxGraph behavior. Changes: - Store editor reference explicitly using `const editor = this` - Use `editor` instead of `this` in the callback to make intent clear - Add test to verify correct editor context in double-click handler This matches the mxGraph pattern where `mxUtils.bind(this, ...)` was used to ensure the callback had the correct editor context.
WalkthroughBind the editor instance into the double-click callback so the handler uses the editor (not the graph) and add a test that fires a DOUBLE_CLICK event to ensure the configured dblClickAction is executed with the target cell. Changes
Sequence Diagram(s)sequenceDiagram
participant DOM as DOM
participant Graph as Graph
participant Editor as Editor
participant Exec as editor.execute(action, cell)
rect #f0f9ff
DOM->>Graph: user double-clicks cell
Graph->>Editor: emit DOUBLE_CLICK EventObject(cell)
end
rect #e8f5e9
Editor->>Exec: call execute(dblClickAction, cell)
Exec-->>Editor: action executed
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
📜 Recent review details Configuration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📥 CommitsReviewing files that changed from the base of the PR and between 421b038 and 41b1e48. 📒 Files selected for processing (1)
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. ❤️ ShareComment @coderabbitai help to get the list of available commands and usage tips. |
Sorry, something went wrong.
|
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Fix issue where the this reference in the double-click handler
callback was incorrectly bound to the graph instance instead of the
editor instance, breaking compatibility with mxGraph behavior.
Changes:
This matches the mxGraph pattern where mxUtils.bind(this, ...) was
used to ensure the callback had the correct editor context.
Notes
Closes #360
Summary by CodeRabbit
Tests
Bug Fixes
Refactor