Skip to content

Add ItemContextMenuClicked Event Support - #303

Merged
danheron merged 6 commits into
danheron:devfrom
wrakocy:item-context-menu-clicked
Jan 13, 2026
Merged

Add ItemContextMenuClicked Event Support #303
danheron merged 6 commits into
danheron:devfrom
wrakocy:item-context-menu-clicked

Conversation

@wrakocy

@wrakocy wrakocy commented Jan 12, 2026

Copy link
Copy Markdown
Contributor

What changed

  • Added ItemContextMenuClicked event callback to MudCalendar component
  • Created CalendarItemClickEventArgs<T> class to pass both MouseEventArgs and the clicked calendar item
  • Implemented context menu handlers in MonthView and DayWeekViewBase
  • Added @oncontextmenu:stopPropagation directive to prevent event bubbling
  • Added bUnit test to verify new functionality

Why

  • Offers users the ability to show context menus when right-clicking on calendar items, similar to the existing CellContextMenuClicked functionality for cells
  • Enables actions like editing, deleting, or viewing details of specific calendar items via right-click
  • Provides consistent API pattern matching CellContextMenuClicked behavior

Notes

  • Breaking changes: None
  • API additions:
    • MudCalendar.ItemContextMenuClicked parameter of type EventCallback<CalendarItemClickEventArgs<T>>
    • CalendarItemClickEventArgs<T> class with MouseEventArgs and Item properties
  • Works across all calendar views
  • Coexists with ItemClicked (both events can be used together)
  • Test component demonstrates usage (right-click on calendar items to trigger the event)

Demo 1: Log Both Cell and Item Context Menu Click Events

Cell.and.Item.Events.Demo.mp4

Demo 2: Show Item Context Menu

Item.Context.Menu.Demo.mp4

@danheron
danheron merged commit 3824cd5 into danheron:dev Jan 13, 2026
@danheron

Copy link
Copy Markdown
Owner

Thanks!

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.

2 participants