Skip to content

Commit 96123d4

Browse files
committed
Avoid warnings and simplify check when is possible
1 parent 213807d commit 96123d4

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/components/BFormSelect/BFormSelect.vue

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ onActivated(handleAutofocus)
109109
// /lifecycle events
110110
111111
// computed
112+
// noinspection PointlessBooleanExpressionJS
112113
const classes = computed(() => ({
113114
'form-control': props.plain,
114115
[`form-control-${props.size}`]: props.size && props.plain,
@@ -126,14 +127,15 @@ const computedSelectSize = computed<number | undefined>(() => {
126127
})
127128
128129
const computedAriaInvalid = computed<'grammar' | 'spelling' | boolean | undefined>(() => {
129-
if (props.state === false) {
130-
return true
131-
}
132-
if (props.state === true) {
130+
// noinspection SuspiciousTypeOfGuard
131+
if (typeof props.state === 'boolean') {
132+
if (!props.state) {
133+
return true
134+
}
133135
return undefined
134136
}
135137
if (typeof props.ariaInvalid === 'boolean') {
136-
if (props.ariaInvalid === false) {
138+
if (!props.ariaInvalid) {
137139
return undefined
138140
}
139141
return props.ariaInvalid

0 commit comments

Comments
 (0)