mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 18:31:06 +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) {
|
||||
if(selectorPrimaryFocus === null) {
|
||||
return
|
||||
}
|
||||
const node =
|
||||
(element || innerModal).querySelector(selectorPrimaryFocus) || buttonRef;
|
||||
if (node != null) node.focus();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue