Skip to content

Commit b994576

Browse files
committed
sq
1 parent b825a0b commit b994576

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

packages/form-js-editor/src/features/properties-panel/entries/CustomValidationEntry.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { get, set } from 'min-dash';
33
import { useService, useVariables } from '../hooks';
44

55
import { FeelEntry, isFeelEntryEdited } from '@bpmn-io/properties-panel';
6-
import { useCallback } from 'preact/hooks';
6+
import { useCallback, useMemo } from 'preact/hooks';
77

88
export function CustomValidationEntry(props) {
99
const { editField, field, idPrefix, index } = props;
@@ -36,7 +36,10 @@ function Condition(props) {
3636
const debounce = useService('debounce');
3737
const _variables = useVariables();
3838

39-
const variables = [{ name: 'value', info: '*Current field value*' }, ..._variables];
39+
const variables = useMemo(
40+
() => [{ name: 'value', type: 'keyword', info: 'Returns the current field value.' }, ..._variables],
41+
[_variables],
42+
);
4043

4144
const setValue = (value, error) => {
4245
if (error) {
@@ -79,7 +82,10 @@ function Message(props) {
7982
const debounce = useService('debounce');
8083
const _variables = useVariables();
8184

82-
const variables = [{ name: 'value', info: '*Current field value*' }, ..._variables];
85+
const variables = useMemo(
86+
() => [{ name: 'value', type: 'keyword', info: 'Returns the current field value.' }, ..._variables],
87+
[_variables],
88+
);
8389

8490
const setValue = (value, error) => {
8591
if (error) {

0 commit comments

Comments
 (0)