Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
side="right"
v-model="drawer"
bordered
aria-label="This is an ARIA-Label"
test-attribute="This is an Test attribute"
>
<div v-for="n in contentSize * 2 + 5" :key="n">
Drawer {{ n }} / {{ contentSize * 2 + 5 }}
Expand Down
2 changes: 2 additions & 0 deletions ui/playground/src/pages/layout/layout-drawer-loop.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
side="right"
v-model="drawer"
bordered
aria-label="This is an ARIA-Label"
test-attribute="This is an Test attribute"
>
<div v-for="n in contentSize" :key="n">
Drawer {{ n }} / {{ contentSize }}
Expand Down
18 changes: 16 additions & 2 deletions ui/src/components/drawer/QDrawer.js
Original file line number Diff line number Diff line change
Expand Up @@ -671,9 +671,23 @@ export default createComponent({
}

const mini = isMini.value === true && slots.mini !== void 0

const sortedAttrs = Object.entries(attrs).reduce(
(acc, [ key, value ]) => {
if (key.startsWith('aria-label')) {
acc.labelAttibutes[ key ] = value
}
else {
acc.other[ key ] = value
}
return acc
},
{ labelAttibutes: {}, other: {} }
)

const content = [
h('div', {
...attrs,
...sortedAttrs.other,
key: '' + mini, // required otherwise Vue will not diff correctly
class: [
contentClass.value,
Expand All @@ -696,7 +710,7 @@ export default createComponent({
child.push(
hDir(
'aside',
{ ref: 'content', class: classes.value, style: style.value },
{ ref: 'content', class: classes.value, style: style.value, ...sortedAttrs.labelAttributes },
content,
'contentclose',
props.noSwipeClose !== true && belowBreakpoint.value === true,
Expand Down