From 340709bc3b55502d561dbded5985e176def3d4ef Mon Sep 17 00:00:00 2001 From: Dmitri Pisarev Date: Fri, 23 Mar 2018 11:08:55 +0300 Subject: [PATCH] BUGFIX: only re-focust when selecting a different node --- .../neos-ui-guest-frame/src/initializeGuestFrame.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/neos-ui-guest-frame/src/initializeGuestFrame.js b/packages/neos-ui-guest-frame/src/initializeGuestFrame.js index be52a87fe2..3c19f36539 100644 --- a/packages/neos-ui-guest-frame/src/initializeGuestFrame.js +++ b/packages/neos-ui-guest-frame/src/initializeGuestFrame.js @@ -1,4 +1,5 @@ import {takeEvery, put, select} from 'redux-saga/effects'; +import {$get} from 'plow-js'; import {selectors, actions, actionTypes} from '@neos-project/neos-ui-redux-store'; import {requestIdleCallback} from '@neos-project/utils-helpers'; @@ -79,10 +80,13 @@ export default ({globalRegistry, store}) => function * initializeGuestFrame() { } else if (selectedDomNode) { const contextPath = selectedDomNode.getAttribute('data-__neos-node-contextpath'); const fusionPath = selectedDomNode.getAttribute('data-__neos-fusion-path'); - - store.dispatch( - actions.CR.Nodes.focus(contextPath, fusionPath) - ); + const state = store.getState(); + const focusedNodeContextPath = $get('cr.nodes.focused.contextPath', state); + if (focusedNodeContextPath !== contextPath) { + store.dispatch( + actions.CR.Nodes.focus(contextPath, fusionPath) + ); + } } else { store.dispatch(actions.UI.ContentCanvas.setCurrentlyEditedPropertyName('')); store.dispatch(