mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Fix a bug that caused it to jump over nodes when pressing too fast
This commit is contained in:
@@ -134,7 +134,11 @@ function reduceTreeState(store: Store, state: State, action: Action): State {
|
||||
const selectedElement = store.getElementAtIndex(
|
||||
((selectedElementIndex: any): number)
|
||||
);
|
||||
if (selectedElement !== null && selectedElement.children.length > 0) {
|
||||
if (
|
||||
selectedElement !== null &&
|
||||
selectedElement.children.length > 0 &&
|
||||
!selectedElement.isCollapsed
|
||||
) {
|
||||
const firstChildID = selectedElement.children[0];
|
||||
const firstChildIndex = store.getIndexOfElementID(firstChildID);
|
||||
if (firstChildIndex !== null) {
|
||||
|
||||
Reference in New Issue
Block a user