In jest environment: Expand by clicking switcher stays in motion and does not work
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Da chiarire
- Stato di attività
- Ferma
- Stack tecnologico
- react, typescript
- Ambito
- frontend, testing-qa
Direzione di ricerca
Inizia riproducendo il test helper che fa clic su uno switcher di Tree e verifica la presenza dell’elemento ant-tree-treenode-motion. Leggi il gestore di espansione di Tree intorno alla guardia listChanging e analizza il comportamento di useStepQueue di rc-motion, in particolare la pulizia di requestAnimationFrame. Il lavoro è completato quando l’espansione termina nel test e una successiva espansione del nodo viene accettata.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- TypeScript
- Stelle
- 1.3k
- Fork
- 494
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di react-component/tree
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 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 inputForse già presa @hippee-lee l’ha presa 119 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 55/100
react-component/tree#1068 · 1 commento ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 20/100
react-component/tree#983 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
react-component/tree#937 ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
react-component/tree#935 ·
Tutte le issue di react-component/tree
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
tashfeenahmed/freellmapi#2305 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
prime-radiant-inc/evener#8335 ·
I maintainer di solito rispondono entro 1 giorno
-
Calendar: a range's preview stays on the last day pointed at after the pointer leaves the daysAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
vercel-labs/ui#1921 ·
I maintainer di solito rispondono entro 1 giorno
-
docs: a new board's default grant names development, Vercel's API seeds preview and productionAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 65/100
microsoft/monaco-editor#5626 ·
I maintainer di solito rispondono entro 1 giorno