Previously, updates of the node fields from outside the form using setFields did not trigger re-fetching the initial state, and thus providing updated values to the form. This is to avoid unnecessary re-renders of the form and unnecessary requests when setFields is triggered from within the form. This PR resets the initial state, thus triggering a re-render and re-fetch of the initial state, if node.setFields is called from outside the form. This preserves the performance optimization
10 lines
310 B
TypeScript
10 lines
310 B
TypeScript
import { createServerFeature } from '@payloadcms/richtext-lexical'
|
|
|
|
export const ModifyInlineBlockFeature = createServerFeature({
|
|
key: 'ModifyInlineBlockFeature',
|
|
feature: {
|
|
ClientFeature:
|
|
'./collections/Lexical/ModifyInlineBlockFeature/feature.client.js#ModifyInlineBlockFeatureClient',
|
|
},
|
|
})
|