Skip to content

Commit 26c8a6c

Browse files
committed
prevent error when radio button has no name attribute
1 parent 9873ff0 commit 26c8a6c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/dialtone-vue/directives/focustrap_directive/focustrap_utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export function getTabbableElements (container, { includeNegativeTabIndex = fals
4444
export function getFirstFocusCandidate (elements) {
4545
if (!elements.length) return undefined;
4646
const first = elements[0];
47-
if (first.matches('[type="radio"]:not(:checked)')) {
47+
if (first.matches('[type="radio"]:not(:checked)') && first.name) {
4848
return elements.find(el => el.checked && el.name === first.name) || first;
4949
}
5050
return first;

0 commit comments

Comments
 (0)