(fieldName_3: string, schema_1: PrimitiveSchemaDefinition, value_0: string)
| 363 | setTextInputCursorOffset(0); |
| 364 | } |
| 365 | function commitTextField(fieldName_3: string, schema_1: PrimitiveSchemaDefinition, value_0: string) { |
| 366 | const trimmedValue = value_0.trim(); |
| 367 | |
| 368 | // Empty input for non-plain-string types means unset |
| 369 | if (trimmedValue === '' && (schema_1.type !== 'string' || 'format' in schema_1 && schema_1.format !== undefined)) { |
| 370 | unsetField(fieldName_3); |
| 371 | return; |
| 372 | } |
| 373 | if (trimmedValue === '') { |
| 374 | // Empty plain string — keep or unset depending on whether it was set |
| 375 | if (formValues[fieldName_3] !== undefined) { |
| 376 | setField(fieldName_3, ''); |
| 377 | } |
| 378 | return; |
| 379 | } |
| 380 | const validation_0 = validateElicitationInput(value_0, schema_1); |
| 381 | setField(fieldName_3, validation_0.isValid ? validation_0.value : value_0); |
| 382 | updateValidationError(fieldName_3, validation_0.isValid ? undefined : validation_0.error); |
| 383 | } |
| 384 | function resolveFieldAsync(fieldName_4: string, schema_2: PrimitiveSchemaDefinition, rawValue: string) { |
| 385 | if (!signal) return; |
| 386 |
no test coverage detected