Skip to content

Commit 4eff138

Browse files
Don’t set a focus fallback for Dialog’s in demo mode (#3194)
* Don’t set a focus fallback for Dialog’s in demo mode * Update changelog
1 parent 031b39d commit 4eff138

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

packages/@headlessui-react/CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10-
- Nothing yet!
10+
### Fixed
11+
12+
- [internal] Don’t set a focus fallback for Dialog’s in demo mode ([#3194](https://github.com/tailwindlabs/headlessui/pull/3194))
1113

1214
## [2.0.3] - 2024-05-07
1315

packages/@headlessui-react/src/components/dialog/dialog.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ function DialogFn<TTag extends ElementType = typeof DEFAULT_DIALOG_TAG>(
393393
<PortalWrapper>
394394
<FocusTrap
395395
initialFocus={initialFocus}
396-
initialFocusFallback={internalDialogRef}
396+
initialFocusFallback={__demoMode ? undefined : internalDialogRef}
397397
containers={resolveRootContainers}
398398
features={focusTrapFeatures}
399399
>

0 commit comments

Comments
 (0)