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

91
Visualizações
Change innerHTML in electron window

A pretty basic electron question, explaining it by a specific example:

in my first electron app I want to change the innerHTML of a label before sync-copying a larger file.

here's what I wrongfully thought the solution is. with this code, the label text is changed after the file was copied:

renderer.js:

const lbl = document.getElementById('statusLabel')
lbl.innerHTML = "New Description"
fs.copyFileSync(...)

However, I can "force" first updating the label by this:

renderer.js:

const lbl = document.getElementById('statusLabel')
lbl.innerHTML = "New Description"
ipcRenderer.send('copyFile')

main.js:

ipcMain.on('copyFile', () => {
    ipcMain.send('copyFile'))
}

I could replace fs.copyFileSync with any other function - the point is, I only get it to work in the required order by sending the subsequent action to the renderer.

is this intended electron behaviour or did I miss something basic?

about 4 years ago · Juan Pablo Isaza
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