Skip to content

Conversation

@Konyaco
Copy link
Collaborator

@Konyaco Konyaco commented Jun 14, 2025

The focusable parameter in PopupProperties controls certain interaction behaviors, particularly for components like Dialog, Flyout, and Dropdown. Previously, setting it to false allowed users to click the DropdownButton multiple times, which causes animation problems.

However, some components do require this behavior. For example, a MenuBar needs to be able to display a new menu immediately when the user hovers over another menu button.

So, I exposed this parameter, allows components to choose the expected behavior.

Meanwhile, adjusted the focusable setting for Dialog specifically, as Dialog components also need to handle keyboard interactions from users.

… Popup behavior.

Introduced a `focusable` parameter to the `Flyout`, `MenuFlyout`, and related components to control whether the flyout is focusable. This allows interaction with areas outside the flyout when set to `false`. Updated default focus behavior across components for consistency. Adjusted `FluentDialog` and `Dropdown` to align with the new focusable defaults.
@Konyaco Konyaco requested a review from Sanlorng June 14, 2025 14:17
positionProvider: FlyoutPositionProvider = rememberFlyoutPositionProvider(),
onKeyEvent: ((keyEvent: KeyEvent) -> Boolean)? = null,
onPreviewKeyEvent: ((keyEvent: KeyEvent) -> Boolean)? = null,
focusable: Boolean = true,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
focusable: Boolean = true,
focusable: Boolean = onKeyEvent != null || onPreviewKeyEvent != null,

@Sanlorng Sanlorng merged commit 99c24e7 into dev Jul 18, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants