@@ -3,7 +3,7 @@ import { get, set } from 'min-dash';
33import { useService , useVariables } from '../hooks' ;
44
55import { FeelEntry , isFeelEntryEdited } from '@bpmn-io/properties-panel' ;
6- import { useCallback } from 'preact/hooks' ;
6+ import { useCallback , useMemo } from 'preact/hooks' ;
77
88export 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