Skip to content

Commit ed668bf

Browse files
committed
refactor: Check for boolean prop type on state prop
1 parent b583d76 commit ed668bf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/VueDatePicker/components/DatepickerInput.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@
148148
dp__input_readonly: !defaultedTextInput.value.enabled,
149149
dp__input: true,
150150
dp__input_icon_pad: !props.hideInputIcon,
151-
dp__input_valid: Boolean(props.state),
152-
dp__input_invalid: props.state === false,
151+
dp__input_valid: typeof props.state === 'boolean' ? props.state : false,
152+
dp__input_invalid: typeof props.state === 'boolean' ? !props.state : false,
153153
dp__input_focus: isFocused.value || props.isMenuOpen,
154154
dp__input_reg: !defaultedTextInput.value.enabled,
155155
...(defaultedUI.value.input ?? {}),

0 commit comments

Comments
 (0)