Skip to content

Commit

Permalink
chore: Exporting MENU_ENTER_EVENT and dispatchMenuEnterEvent utilitie…
Browse files Browse the repository at this point in the history
…s from @fluentui/react-menu (#28499)

* chore: Exporting MENU_ENTER_EVENT and dispatchMenuEnterEvent utilities from @fluentui/react-menu.

* Adding change file.

* Updating API.
  • Loading branch information
khmakoto authored Jul 18, 2023
1 parent 3cbeb7e commit 5918d22
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
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

0 comments on commit 5918d22

Please sign in to comment.