Fix expression cursor on popup#974
Conversation
…of the expression
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests (beta)
Tip 📝 Customizable high-level summaries are now available in beta!You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.
Example instruction:
Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later. 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 |
Purpose
The expression editor had an issue where newly created variables were always inserted at the start of the editor instead of the current cursor position.
This happened because the editor was explicitly resetting the cursor position when the user clicked outside the editor.
This PR fixes the behavior so new variables insert at the correct cursor location.
Resolves: wso2/product-ballerina-integrator#1968
Goals
Approach
0on blur/outside clicks.viewRef.current?.dom.blur();, the cursor visually disappears for the user, but CodeMirror internally maintains the correct cursor position.