Skip to content

Commit d76dbaa

Browse files
committed
remove shadow from range input element
1 parent eb5b42a commit d76dbaa

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/components/TextInput.vue

+7-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div :class="[$attrs.class]">
33
<slot name="header" :inputElement="inputElement" :id="id" :modelValue="modelValue" :status="status" v-bind="$attrs"></slot>
44
<label v-if="useLabel" :for="id" :class="`block text-sm font-medium text-gray-700 dark:text-gray-300 ${labelClass??''}`">{{ useLabel }}</label>
5-
<div class="mt-1 relative rounded-md shadow-sm">
5+
<div :class="fixShadow('mt-1 relative shadow-sm rounded-md')">
66

77
<input ref="inputElement" :type="useType"
88
:name="id"
@@ -68,9 +68,14 @@ function focus() {
6868
const useType = computed(() => props.type || 'text')
6969
const useLabel = computed(() => props.label ?? humanize(toPascalCase(props.id)))
7070
const usePlaceholder = computed(() => props.placeholder ?? useLabel.value)
71+
function fixShadow(cls:string) {
72+
return props.type === 'range'
73+
? cls.replace('shadow-sm ', '')
74+
: cls
75+
}
7176
7277
let ctx: ApiState|undefined = inject('ApiState', undefined)
7378
const errorField = computed(() => errorResponse.call({ responseStatus: props.status ?? ctx?.error.value }, props.id))
7479
75-
const cls = computed(() => [input.base, errorField.value ? input.invalid : input.valid, props.inputClass])
80+
const cls = computed(() => [input.base, errorField.value ? input.invalid : fixShadow(input.valid), props.inputClass])
7681
</script>

0 commit comments

Comments
 (0)