In jest environment: Expand by clicking switcher stays in motion and does not work
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Facilidade para iniciantes
- 35/100
- Tipo de issue
- Bug
- Clareza
- Precisa de esclarecimento
- Status de atividade
- Estagnada
- Stack de tecnologia
- react, typescript
- Domínio
- frontend, testing-qa
Direção de pesquisa
Comece reproduzindo o teste auxiliar que clica em um switcher de Tree e verifica o elemento ant-tree-treenode-motion. Leia o handler de expansão de Tree em torno do guard listChanging e inspecione o comportamento de useStepQueue do rc-motion, especialmente a limpeza de requestAnimationFrame. Está concluído quando a expansão termina no teste e uma expansão subsequente de um nó é aceita.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
I have a helper function that expands a tree node (node1) by clicking on the switcher element.
- The onExpand handler is invoked with expanded = true.
- But I noticed that the tree is still animation mode. Reasons it is still in animation mode:
-
The child nodes of the expanded node1 are still inside a div element
<div class="ant-tree-treenode-motion">{my 3 child treeNodes are here}</div> -
In the same test, I try to expand another node (node2) but it does not expand. I debugged and learned that the Tree component rejects node2 expand (Tree's expand handler is correctly invoked) because of the below code ...
var key = treeNode.key, expanded = treeNode.expanded; // Do nothing when motion is in progress if (listChanging) { return; } -
I also debugged further and went into the
rc-motioncode. The hook useStepQueue's below code is invoked and the requestAnimationFrame is canceled (I am not sure if this is normal or not). But the step never moved forward from "NONE"
-
React.useEffect(function () {
return function () {
cancelNextFrame();
};
}, []);
- I studied the test code in this repo. The test clicks on a switcher and makes sure the handler is invoked. It does not test if the tree is in animation mode or not. I have written this code to make sure the Tree is not animating:
isAnimating: (tree: HTMLElement) => {
return !!tree.querySelector('.ant-tree-treenode-motion');
},
We use the Tree component a lot in our UI and we need to test our features. Appreciate if you guys can help.
- Linguagem predominante
- TypeScript
- Estrelas
- 1.3k
- Forks
- 494
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Preparar o ambiente
Este projeto não oferece contêiner de desenvolvimento, Dockerfile nem guia de contribuição, então a configuração fica por sua conta: comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de react-component/tree
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 48/100
react-component/tree#1080 ·
-
Tree crashes on mount with `Cannot read properties of null (reading 'scrollTo')` when a node title contains an autoFocus inputTalvez já em andamento @hippee-lee assumiu há 119 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 55/100
react-component/tree#1068 · 1 comentário ·
-
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 20/100
react-component/tree#983 ·
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 35/100
react-component/tree#937 ·
-
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 25/100
react-component/tree#935 ·
Todas as issues de react-component/tree
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
tashfeenahmed/freellmapi#2305 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
prime-radiant-inc/evener#8335 ·
Mantenedores costumam responder em até 1 dia
-
Calendar: a range's preview stays on the last day pointed at after the pointer leaves the daysAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
vercel-labs/ui#1921 ·
Mantenedores costumam responder em até 1 dia
-
docs: a new board's default grant names development, Vercel's API seeds preview and productionAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 1/5 1-3 horas Facilidade para iniciantes 65/100
microsoft/monaco-editor#5626 ·
Mantenedores costumam responder em até 1 dia