vuestic-ui icon indicating copy to clipboard operation
vuestic-ui copied to clipboard

Let VaDateInput accept a null value

Open Bond-Addict opened this issue 2 years ago • 0 comments

Allow a user to have a null date input. Dev's will have to handle validation as they normal would with other controls.

Description

Currently you have to provide a date input regardless of whether or not you have any rules. This just allow a user to remove the date inputted and be able to pass the form validation.

const onInputTextChanged = ({ target }: Event) => {
  if (props.disabled) { return }

  const inputValue = (target as HTMLInputElement).value

  if (isValid.value) {
    valueComputed.value = inputValue === '' ? null : parseDateInputValue(inputValue)
  }
}

Types of changes

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [ ] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [x] Improvement/refactoring (non-breaking change that doesn't add any feature but make things better)

Bond-Addict avatar Mar 01 '24 19:03 Bond-Addict