Hi,
I have a typedInput field which uses a custom type. My custom type has a specific validate function which is working well inside the property panel (when the entered value does not match the validate pattern, then the input field has a red border), but this validate function does not prevent the node from being deployed.
Actually I was expecting the custom type validate function to behave like for the predefined types (flow, global, json, num, ...) meaning when the entered value in typedInput field does not match the required type, then the node appears with the red triangle on the workspace and a popup warning message is displayed at deploy, but it seems not the case for the custom type.
Is it a normal behavior ? Is there a way to workaround ?
For information here is my typedInput field declaration. The issue is related to custom type where the validate function does not prevent to deploy when entering wrong values (for instance "blablabla") in field:
$('#node-input-frequency').typedInput({
default: '0',
typeField: "#node-input-propertyType",
types: [
{
value: "1",
label: "1Hz",
hasValue: false
},
{
value: "10",
label: "10Hz",
hasValue: false
},
{
value: "100",
label: "100Hz",
hasValue: false
}, {
value: "1000",
label: "1000Hz",
hasValue: false
},
{
value: "custom",
label: "Custom (in Hz) :",
validate: /^[0-9]*(\.[0-9]+)?$/
}
],
});