In jest environment: Expand by clicking switcher stays in motion and does not work
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 35/100
- Issue-Typ
- Bug
- Klarheit
- Muss geklärt werden
- Aktivitätsstatus
- Veraltet
- Tech-Stack
- react, typescript
- Bereich
- frontend, testing-qa
Rechercherichtung
Beginne damit, den Helper-Test zu reproduzieren, der auf einen Tree-Switcher klickt und das Element ant-tree-treenode-motion prüft. Lies den Tree-Expand-Handler rund um den listChanging-Guard und untersuche das Verhalten von rc-motions useStepQueue, insbesondere die Bereinigung von requestAnimationFrame. Fertig ist es, wenn die Expansion im Test abgeschlossen wird und eine anschließende Node-Expansion akzeptiert wird.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 1.3k
- Forks
- 494
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Entwicklungsumgebung
Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus react-component/tree
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 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 inputEvtl. vergeben @hippee-lee hat das vor 119 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 55/100
react-component/tree#1068 · 1 Kommentar ·
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 20/100
react-component/tree#983 ·
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 35/100
react-component/tree#937 ·
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 25/100
react-component/tree#935 ·
Alle Issues in react-component/tree
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
tashfeenahmed/freellmapi#2305 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
prime-radiant-inc/evener#8335 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Calendar: a range's preview stays on the last day pointed at after the pointer leaves the daysOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
vercel-labs/ui#1921 ·
Maintainer antworten meist innerhalb von 1 Tag
-
docs: a new board's default grant names development, Vercel's API seeds preview and productionOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 65/100
microsoft/monaco-editor#5626 ·
Maintainer antworten meist innerhalb von 1 Tag