Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .changeset/chore-flyout-content-focus-handlers.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
'@clickhouse/click-ui': patch
---

Restore `onOpenAutoFocus` and `onCloseAutoFocus` props to `FlyoutContentProps`.

These focus management props were inadvertently removed during the decoupling from Radix UI types. They are now explicitly added back to provide parity with the `Dialog` component and support common accessibility use cases.

Note: These props are optional and only needed when customizing default focus behavior.

**How to use?**

```tsx
<Flyout.Content
onOpenAutoFocus={(e) => {
// Prevent default focus behavior
e.preventDefault();
// Implement custom focus logic
}}
onCloseAutoFocus={() => {
// Handle focus when flyout closes
}}
>
{children}
</Flyout.Content>
```
2 changes: 2 additions & 0 deletions src/components/Flyout/Flyout.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ export interface FlyoutContentProps extends HTMLAttributes<HTMLDivElement> {
onEscapeKeyDown?: (event: KeyboardEvent) => void;
onPointerDownOutside?: (event: CustomEvent) => void;
onFocusOutside?: (event: CustomEvent) => void;
onOpenAutoFocus?: (event: Event) => void;
onCloseAutoFocus?: (event: Event) => void;
}

interface TitleHeaderProps extends Omit<
Expand Down
Loading