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

When there are two editors on a page, changing one theme will affect the other #4

Open
zeroHW opened this issue Mar 11, 2020 · 3 comments

Comments

@zeroHW
Copy link

zeroHW commented Mar 11, 2020

When I use react-monacoeditor I get this bug. There are two react-monacoeditor in my page, a loaded one is vs-light and a unloaded one is vs-dark. After the unloaded one is loaded, the loaded one will become vs-dark. I think they should not influence each other.

@jaywcjlove
Copy link
Member

@zeroHW Can give an example?

@zeroHW
Copy link
Author

zeroHW commented Mar 12, 2020

@jaywcjlove 我遇到的情况是这样的,同一页面上有两个编辑器,1号已加载的主题是vs-light,2号预加载的主题是vs-dark,正常状态应该是1号和2号的主题互不影响,但实际状态是2号加载以后,1号的主题会变为vs-dark。

@tobiashochguertel
Copy link

example:

            <Container fluid>
              <Row>
                {/* <Col>
                  <h6>Values</h6>
                </Col> */}
                <Col>
                  <h6>Selected File</h6>
                  <MonacoEditor
                    language="html"
                    value="<h1>I ♥ react-monacoeditor</h1>"
                    options={{
                      theme: 'vs-light',
                    }}
                  />
                </Col>
                <Col>
                  <h6>Render Output</h6>
                  <MonacoEditor
                    language="yaml"
                    value="<h1>I ♥ react-monacoeditor</h1>"
                    options={{
                      theme: 'vs-dark',
                      readOnly: true,
                    }}
                  />
                </Col>
              </Row>
            </Container>

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

3 participants