Skip to content

Commit

Permalink
Fix additionalTrapElements to accept HTMLelements as well
Browse files Browse the repository at this point in the history
Signed-off-by: greta <gretadoci@gmail.com>
  • Loading branch information
GretaD committed Jan 23, 2024
1 parent d244701 commit 24fe0ac
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 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

0 comments on commit 24fe0ac

Please sign in to comment.