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

179
Visualizações
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 à 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