Skip to content

Commit 8ad8eed

Browse files
Merge pull request #35 from ShlomoPorges/development
Fixed change focus component
2 parents 88b455b + 75e799f commit 8ad8eed

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/utils/componentReducer.util.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,10 @@ export const deleteComponent = (state, { componentId }) => {
285285

286286
export const changeFocusComponent = (state, { title }) => {
287287
const newFocusComp = state.components.find(comp => comp.title === title);
288+
// set the "focus child" to the focus child of this particular component .
289+
const newFocusChildId = newFocusComp.focusChildId ;
290+
291+
const newFocusChild = newFocusComp.childrenArray.find( child => child.childId == newFocusChildId) ;
288292

289293
const result = getSelectable(newFocusComp, state.components);
290294

@@ -293,6 +297,7 @@ export const changeFocusComponent = (state, { title }) => {
293297
focusComponent: newFocusComp,
294298
selectableChildren: result.selectableChildren,
295299
ancestors: result.ancestors,
300+
focusChild: newFocusChild,
296301
};
297302
};
298303

0 commit comments

Comments
 (0)