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

Fix: use options object with defaults #30

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

harrel56
Copy link

If we register module with some default options, e.g.:

MonacoEditorModule.forRoot({defaultOptions: { theme: 'vs-dark' }})

and use component like:

<ngx-monaco-editor [options]="{readOnly: readOnlyFlag}"></ngx-monaco-editor>

upon first render the options will get merged, but on next rerenders it will just use {readOnly: readOnlyFlag} without default - so toggling readOnlyFlag will remove the theme: vs-dark option.

@harrel56
Copy link
Author

harrel56 commented Feb 5, 2025

@miki995 any updates on this? can we merge this?

@miki995
Copy link
Owner

miki995 commented Feb 7, 2025

@harrel56 can you make a simple example so I can see the bug?

@harrel56
Copy link
Author

harrel56 commented Feb 7, 2025

@miki995 It can be observed on your demonstration page:

  • notice that first editor doesn't have a scroll bar (because of global default setting)
  • click "Change Language" and notice that the scroll bar appears (global default setting is gone)

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

Successfully merging this pull request may close these issues.

None yet

2 participants