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

180
Vistas
Fancy Tree dnd5 doesn't work when dragging over valid and invalid folders at the same time

Dragging a file right away to a valid folder works but when I try to drag a file across an invalid folder and then back to a valid folder, it fails. It logs this in the console when I am dragging across an invalid folder. Do I somehow need to manually change this property? Fancytree@1 applyDropEffectCallback: allowDrop === false

my current code is simple.

        dragStart: function(node, data) {
          //Prevent user from moving folder
            if (node.isFolder()) {
              return false
            } 
              return true
        },
        dragEnter: function(node, data) {
            if (node.data.restricted){
               return false;
            }
            return true;
        }}

Structure of my fancy tree.

Root Folder
   --Sub Folder 1
   --Sub Folder 2
   --Sub Folder 3

Inside each subfolder is a file that I am trying to drag and drop to another valid folder. Each folder has a property called restricted that I check against to know if it's a valid folder to drop in. In the above case, the root folder and subfolder 3 are invalid. If I drag and drop a file from folder 1 to folder 2. It works. But when I dnd it from folder 1 to folder 3(it will restrict me as intended), and still holding the mouse click, back to folder 2. It remains restricted(dragEnter logs true correctly) and now I can not drop the file in any valid folder. Once I let go of the mouse click, the same behavior repeats where I can dnd into a valid folder initally.

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