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

ROU-4386: ContextMenu - avoid raising twice ToggleEvent when opening #342

Merged
merged 1 commit into from
Jun 14, 2023
Merged
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
17 changes: 11 additions & 6 deletions src/Providers/DataGrid/Wijmo/Features/ContextMenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,17 @@ namespace Providers.DataGrid.Wijmo.Feature {
},
isDroppedDownChanging: (e) => {
// The event is raised when the context menu opens or closes.
// It is easier to understand if it will open instead of analysing if the menu is dropped down.
this._isOpening = !e.isDroppedDown;
this._contextMenuEvents.trigger(
OSFramework.DataGrid.Event.Feature
.ContextMenuEventType.Toggle
);

//If the menu is (currently) open, then this event was fired to close it.
//Otherwise, if closed, means that it will open, so we'll not do anything here.
if (e.isDroppedDown) {
// It is easier to understand if it will open instead of analysing if the menu is dropped down.
this._isOpening = false;
this._contextMenuEvents.trigger(
OSFramework.DataGrid.Event.Feature
.ContextMenuEventType.Toggle
);
}
}
}
);
Expand Down