defaultEmptyValueString.ts 357 B

1234567891011121314
  1. // Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. import type { FormKitNode } from '@formkit/core'
  3. const defaultEmptyValueString = (node: FormKitNode) => {
  4. node.hook.input((payload, next) => {
  5. if (payload === undefined) {
  6. return next('')
  7. }
  8. return next(payload)
  9. })
  10. }
  11. export default defaultEmptyValueString