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

278
Vistas
select directory is not working using electron.js

I am using "electron": "^16.0.7", I am trying to select directory by using "webkitdirectory". Whether it select's files instead of selecting folder. And then retrieve the path of file from by using another function. While the "onchange" selects file instead of folders.

The below code creates an element like this,

input.current = document.createElement('input')
input.current.type = 'file'
input.current.webkitdirectory = true
input.current.msdirectory = true
input.current.onchange = (e) => {
  const { files } = input.current
  watchFiles(files)
  input.current.value = ''
}

function watchFiles(files: FileList) {
if (files) {
  for (let i = 0; i < files.length; i++) {
    const path = files[i] && (files[i].path || files[i].name)
    if (path) {
      const newId = uniqid()
      dispatch(addProject(newId, path))
    }
  }
}

}

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