Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Exporting MENU_ENTER_EVENT and dispatchMenuEnterEvent utilities from @fluentui/react-menu #28499

Merged
merged 3 commits into from
Jul 18, 2023
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "minor",
"comment": "chore: Exporting MENU_ENTER_EVENT and dispatchMenuEnterEvent utilities.",
"packageName": "@fluentui/react-menu",
"email": "Humberto.Morimoto@microsoft.com",
"dependentChangeType": "patch"
}
6 changes: 6 additions & 0 deletions packages/react-components/react-menu/etc/react-menu.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,15 @@ import type { SlotClassNames } from '@fluentui/react-utilities';
import type { TriggerProps } from '@fluentui/react-utilities';
import type { UseOnClickOrScrollOutsideOptions } from '@fluentui/react-utilities';

// @public
export const dispatchMenuEnterEvent: (el: HTMLElement, nativeEvent: MouseEvent) => void;

// @public
export const Menu: React_2.FC<MenuProps>;

// @public
export const MENU_ENTER_EVENT = "fuimenuenter";

// @public (undocumented)
export type MenuCheckedValueChangeData = {
checkedItems: string[];
Expand Down
2 changes: 1 addition & 1 deletion packages/react-components/react-menu/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,4 @@ export {
} from './MenuItemLink';
export type { MenuItemLinkProps, MenuItemLinkSlots, MenuItemLinkState } from './MenuItemLink';

export { useOnMenuMouseEnter } from './utils';
export { MENU_ENTER_EVENT, dispatchMenuEnterEvent, useOnMenuMouseEnter } from './utils';
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ export const useOnMenuMouseEnter = (options: UseOnClickOrScrollOutsideOptions) =

/**
* Dispatches the custom MouseEvent enter event. Similar to calling `el.click()`
* @param el element for the event target
* @param nativeEvent the native mouse event this is mapped to
* @param el - element for the event target
* @param nativeEvent - the native mouse event this is mapped to
*/
export const dispatchMenuEnterEvent = (el: HTMLElement, nativeEvent: MouseEvent) => {
el.dispatchEvent(new CustomEvent(MENU_ENTER_EVENT, { bubbles: true, detail: { nativeEvent } }));
Expand Down