Skip to content

How to use a component variable as model for monaco editor? #610

Answered by adamghill
soraphis asked this question in Q&A
Discussion options

You must be logged in to vote

when anything in the component changes the editor vanishes

This might be happening because the morphdom library is removing the editor. Have you tried ignoring that part of the component with https://www.django-unicorn.com/docs/templates/#ignore-elements?

when I bind monaco.editor.create to the Unicorn "updated" event, I lose the cursor position in the editor

Hmm, I'm not sure what might be happening here. Can you make a repo with some code that replicates this so I could try it out?

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@soraphis
Comment options

Answer selected by soraphis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants