Skip to content

Commit

Permalink
refactor: Check for boolean prop type on state prop
Browse files Browse the repository at this point in the history
  • Loading branch information
Jasenkoo committed Jul 14, 2024
1 parent b583d76 commit ed668bf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/VueDatePicker/components/DatepickerInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@
dp__input_readonly: !defaultedTextInput.value.enabled,
dp__input: true,
dp__input_icon_pad: !props.hideInputIcon,
dp__input_valid: Boolean(props.state),
dp__input_invalid: props.state === false,
dp__input_valid: typeof props.state === 'boolean' ? props.state : false,
dp__input_invalid: typeof props.state === 'boolean' ? !props.state : false,
dp__input_focus: isFocused.value || props.isMenuOpen,
dp__input_reg: !defaultedTextInput.value.enabled,
...(defaultedUI.value.input ?? {}),
Expand Down

0 comments on commit ed668bf

Please sign in to comment.