From 2120fe8604a115a268feb7904dfc5354187b694b Mon Sep 17 00:00:00 2001 From: Razvan Stoenescu Date: Tue, 3 Sep 2024 15:07:26 +0300 Subject: [PATCH] fix(ui): QList role computed prop -> lint issue & never return undefined (fix: #17439) (#17441) --- ui/src/components/item/QList.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ui/src/components/item/QList.js b/ui/src/components/item/QList.js index b6010f71ee9..65d7569f0b8 100644 --- a/ui/src/components/item/QList.js +++ b/ui/src/components/item/QList.js @@ -4,6 +4,8 @@ import { createComponent } from '../../utils/private.create/create.js' import useDark, { useDarkProps } from '../../composables/private.use-dark/use-dark.js' import { hSlot } from '../../utils/private.render/render.js' +const roleAttrExceptions = [ 'ul', 'ol' ] + export default createComponent({ name: 'QList', @@ -25,6 +27,10 @@ export default createComponent({ const vm = getCurrentInstance() const isDark = useDark(props, vm.proxy.$q) + const role = computed(() => ( + roleAttrExceptions.includes(props.tag) ? null : 'list') + ) + const classes = computed(() => 'q-list' + (props.bordered === true ? ' q-list--bordered' : '') @@ -34,8 +40,6 @@ export default createComponent({ + (props.padding === true ? ' q-list--padding' : '') ) - const role = computed(() => props.tag === 'ul' || props.tag === 'ol' ? undefined : 'list') - return () => h(props.tag, { class: classes.value, role: role.value }, hSlot(slots.default)) } })