Skip to content

Commit 792163e

Browse files
authored
fix(Dialog): removed autofocus from closeButton (#4159)
1 parent 6bc38ae commit 792163e

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

.changeset/violet-loops-lead.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@digdir/designsystemet-react": patch
3+
---
4+
5+
**Dialog**: Removed the autofocus attribute from built in closeButton, which prevented setting autofocus on other elements in Dialog.

packages/react/src/components/dialog/dialog.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@ export const Dialog = forwardRef<HTMLDialogElement, DialogProps>(
156156
{closeButton !== false && (
157157
<Button
158158
aria-label={closeButton}
159-
autoFocus
160159
data-color='neutral'
161160
icon
162161
variant='tertiary'

0 commit comments

Comments
 (0)