Fix focus on first element

This commit is contained in:
Julien Nahum 2022-10-28 11:13:10 +02:00
parent 6abf36702b
commit e95e13d8f9
2 changed files with 2 additions and 2 deletions

View File

@ -11,7 +11,7 @@
</small>
<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 }]"
@click="onSelect(option[optionKey])"
>

View File

@ -133,7 +133,7 @@ export default {
if (this.isIframe) return
// Auto focus on first input
const visibleElements = []
document.querySelectorAll('input,button').forEach(ele => {
document.querySelectorAll('input,button,textarea,[role="button"]').forEach(ele => {
if (ele.offsetWidth !== 0 || ele.offsetHeight !== 0) {
visibleElements.push(ele)
}