Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

173
Visualizações
Strange style issues with Monaco Editor in Electron

When I embedded the Monaco editor in my Electron app following the electron-amd-sample, the editor behaves as intended.

However, the example demonstrates instantiating the editor inside a script tag within an HTML page, whereas I would like to access the editor within my projects Javascript files.

I added the following code to a JS file to instantiate the editor, and observed a few strange style issues with the editor:

  1. When I click on the scroll-menu, it turns white rather than having a bit of transparency:enter image description here
  2. When I click go-to-references, the window appears and then starts to shrink until it disappears: enter image description here

Note that I have other css defined for the page I have now embedded the editor in, whereas it was previously running in an isolated browser window. I'm not sure how to tell if this is an issue though.

/**
 * Sets up the Monaco code editor and links it to the code container div.
 *
 * @returns a Promise and passes the editor to resolve.
 */
async function setupMonacoEditor() {
    return new Promise((resolve, reject) => {
        amdRequire(['vs/editor/editor.main'], function () {
            const editor = monaco.editor.create(
                document.getElementById('ideCodeContainer'),
                {
                    language: 'javascript',
                    theme: vs-dark,
                    automaticLayout: true,
                }
            );
            resolve(editor);
        });
    });
}
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Well it turns out there were two issues:

  1. I defined a css class .active, way too generic, which was conflicting with the color of the scroll menu.
  2. Setting
webFrame.setZoomFactor(Math.min(0.00104058272 * height, 0.00059523809 * width));

within electron is causing the resize of the references window.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda