Fix focus on first element
This commit is contained in:
parent
6abf36702b
commit
e95e13d8f9
|
@ -11,7 +11,7 @@
|
||||||
</small>
|
</small>
|
||||||
|
|
||||||
<loader v-if="loading" key="loader" class="h-6 w-6 text-nt-blue mx-auto" />
|
<loader v-if="loading" key="loader" class="h-6 w-6 text-nt-blue mx-auto" />
|
||||||
<div v-for="(option, index) in options" v-else :key="option[optionKey]"
|
<div v-for="(option, index) in options" v-else :key="option[optionKey]" role="button"
|
||||||
:class="[theme.default.input,'cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-900 flex',{ 'mb-2': index !== options.length,'ring-red-500 ring-2': hasValidation && form.errors.has(name), 'cursor-not-allowed bg-gray-200':disabled }]"
|
:class="[theme.default.input,'cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-900 flex',{ 'mb-2': index !== options.length,'ring-red-500 ring-2': hasValidation && form.errors.has(name), 'cursor-not-allowed bg-gray-200':disabled }]"
|
||||||
@click="onSelect(option[optionKey])"
|
@click="onSelect(option[optionKey])"
|
||||||
>
|
>
|
||||||
|
|
|
@ -133,7 +133,7 @@ export default {
|
||||||
if (this.isIframe) return
|
if (this.isIframe) return
|
||||||
// Auto focus on first input
|
// Auto focus on first input
|
||||||
const visibleElements = []
|
const visibleElements = []
|
||||||
document.querySelectorAll('input,button').forEach(ele => {
|
document.querySelectorAll('input,button,textarea,[role="button"]').forEach(ele => {
|
||||||
if (ele.offsetWidth !== 0 || ele.offsetHeight !== 0) {
|
if (ele.offsetWidth !== 0 || ele.offsetHeight !== 0) {
|
||||||
visibleElements.push(ele)
|
visibleElements.push(ele)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue