mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 10:21:05 +00:00
Merge pull request #393 from weaseldotro/patch-1
feat(ComposedModal): allow using null for selectorPrimaryFocus to disable auto focus
This commit is contained in:
commit
db4b7b1f6b
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