Skip to content

Commit

Permalink
Merge pull request neos#1714 from neos/dimaip-fix-focus-again
Browse files Browse the repository at this point in the history
BUGFIX: only re-focust when selecting a different node
  • Loading branch information
dimaip authored Mar 23, 2018
2 parents 122842e + 340709b commit d32c7a1
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions packages/neos-ui-guest-frame/src/initializeGuestFrame.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit d32c7a1

Please sign in to comment.