You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: initial values & getters for field/editor API (#1444)
# Initial values
When passing a callback to the following methods at the very start of the app, it was called with `undefined` instead of its initial value
- `sdk.field.onIsDisabledChanged`
- `sdk.field.onSchemaErrorsChanged`
- `sdk.editor.onLocaleSettingsChanged`
- `sdk.editor.onShowDisabledFieldsChanged`
This is now fixed and the callback is immediately invoked with the correct value.
# Getters
The following methods are added
- `sdk.field.getIsDisabled()`
- `sdk.field.getSchemaErrors()`
- `sdk.editor.getLocaleSettings()`
- `sdk.editor.getShowHiddenFields()`
# Deprecation
`sdk.editor.onShowDisabledFieldsChanged` is now deprecated and replaced by `sdk.editor.onShowHiddenFieldsChanged`
* Subscribes to changes of whether or not disabled fields are displayed
148
+
*
149
+
* @param callback Function that is called every time the setting whether or not disabled fields are displayed changes. Called immediately with the current state.
150
+
* @returns Function to unsubscribe. `callback` won't be called anymore.
151
+
* @deprecated Use {@link onShowHiddenFieldsChanged} instead
* Returns whether or not hidden fields are displayed
157
+
*
158
+
* This setting can change. To always work with the latest settings, use `onShowHiddenFieldsChanged`.
159
+
*/
160
+
getShowHiddenFields(): boolean
161
+
162
+
/**
163
+
* Subscribes to changes of whether or not hidden fields are displayed
164
+
*
165
+
* @param callback Function that is called every time the setting whether or not hidden fields are displayed changes. Called immediately with the current state.
166
+
* @returns Function to unsubscribe. `callback` won't be called anymore.
0 commit comments