mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 10:21:05 +00:00
feat(ComposedModal): allow using null for selectorPrimaryFocus to disable auto focus
This commit is contained in:
parent
3bc6587ee7
commit
b754e0cf79
1 changed files with 3 additions and 0 deletions
|
@ -69,6 +69,9 @@
|
||||||
});
|
});
|
||||||
|
|
||||||
function focus(element) {
|
function focus(element) {
|
||||||
|
if(selectorPrimaryFocus === null) {
|
||||||
|
return
|
||||||
|
}
|
||||||
const node =
|
const node =
|
||||||
(element || innerModal).querySelector(selectorPrimaryFocus) || buttonRef;
|
(element || innerModal).querySelector(selectorPrimaryFocus) || buttonRef;
|
||||||
if (node != null) node.focus();
|
if (node != null) node.focus();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue