Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

172
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!