Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CodeMirrorMerge - Selection lost when updating #713

Open
guillermoamaral opened this issue Feb 11, 2025 · 0 comments
Open

CodeMirrorMerge - Selection lost when updating #713

guillermoamaral opened this issue Feb 11, 2025 · 0 comments

Comments

@guillermoamaral
Copy link

guillermoamaral commented Feb 11, 2025

Hey there,

I have implemented an IDE, being the main component of it the CodeEditor (a customized wrapper of your CodeMirror). In it, I have used onContextMenu property to manage a personalized pop-up menu providing many options (such as reference search based on selected code, etc.). Here is how it looks:

Image

When it came to provide a code-diff tool, I used CodeMerge and tried to do the same but, and here is the issue, when my component (CodeMerge) is rerendered to display the pop-up menu, the selected code is lost.

Here is an example of what I have.

Moreover, I ended up attaching the menu to CodeMirrorMerge component because (and that was my first attempt), it did not work to do it on Original and Modified parts. However, I will need to identify from which part the menu was opened to get the corresponding selected code.

Any suggestion?

Thanks in advance!

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

No branches or pull requests

1 participant