formio.js
formio.js copied to clipboard
[BUG] ComponentSchema.persistent should be of type (boolean | 'client-only')
Environment
Please provide as many details as you can:
- Hosting type
- [ ] Form.io
- [ ] Local deployment
- Version:
- Formio.js version: 4.9.27-rc.4
- Frontend framework:
- Browser:
- Browser version:
Steps to Reproduce
Setting the property persistent to client-only is a bit tricky:
const schema: ExtendedComponentSchema = {
hideLabel: true
};
(schema as any).persistent = 'client-only';
Expected behavior
It should be as simple as
const schema: ExtendedComponentSchema = {
hideLabel: true,
persistent: 'client-only'
};
Observed behavior
Currently you get the error Type 'string' is not assignable to type 'boolean' because persistent is of type boolean instead of boolean | 'client-only'
@davebaol Hi could you please confirm if this issue persists in version 4.10.2?
@jhen1422 I'd say yes, the issue is still there in 4.10.2: https://github.com/formio/formio.js/blob/v4.10.2/types/components/schema.d.ts#L71
I am using 4.13.8 and the issue is still there.
Closing this thread as it is outdated. Please re-open if it is still relevant. Thank you for your contribution!