Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

174
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda