Skip to content

Commit

Permalink
Merge pull request neos#3833 from grebaldi/bugfix/3832/prevent-remote…
Browse files Browse the repository at this point in the history
…-calls-when-inline-editor-is-unchanged

BUGFIX: Prevent unneccessary server calls when inline editor is unchanged
  • Loading branch information
grebaldi authored Jul 18, 2024
2 parents fa4f3f7 + 180906d commit fda27d7
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion packages/neos-ui-guest-frame/src/initializePropertyDomNode.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {$get, $contains} from 'plow-js';

import {actions} from '@neos-project/neos-ui-redux-store';
import {actions, selectors} from '@neos-project/neos-ui-redux-store';
import {validateElement} from '@neos-project/neos-ui-validators';

import {getGuestFrameWindow, closestContextPathInGuestFrame} from './dom';
Expand Down Expand Up @@ -74,6 +74,14 @@ export default ({store, globalRegistry, nodeTypesRegistry, inlineEditorRegistry,
actions.Changes.persistChanges([change])
),
onChange: value => {
const node = selectors.CR.Nodes.byContextPathSelector(contextPath)(store.getState());
if (node) {
const oldValue = node.properties[propertyName];
if (oldValue === value) {
return;
}
}

const validationResult = validateElement(value, $get(['properties', propertyName], nodeType), globalRegistry.get('validators'));
// Update inline validation errors
store.dispatch(
Expand Down

0 comments on commit fda27d7

Please sign in to comment.