Skip to content

Commit

Permalink
Merge pull request #5120 from nextcloud-libraries/fix/trap-elements-n…
Browse files Browse the repository at this point in the history
…cdialog

Fix additionalTrapElements to accept HTMLelements as well
  • Loading branch information
GretaD committed Jan 23, 2024
2 parents 1498ede + 2729402 commit 72f56e0
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/components/NcDialog/NcDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,14 @@ export default defineComponent({
/** Additional elements to add to the focus trap */
additionalTrapElements: {
type: Array,
validator: (arr) => Array.isArray(arr) && arr.every((element) => typeof element === 'string'),
validator: (arr) => {
return (
Array.isArray(arr) && arr.every(
(element) =>
typeof element === 'string' || element instanceof HTMLElement,
)
)
},
default: () => ([]),
},
Expand Down Expand Up @@ -399,6 +406,7 @@ export default defineComponent({
closeOnClickOutside: props.closeOnClickOutside,
enableSlideshow: false,
enableSwipe: false,
additionalTrapElements: props.additionalTrapElements,
}))
return {
Expand Down

0 comments on commit 72f56e0

Please sign in to comment.