Calendar Add button opens two event dialogs


Topic: Calendar Add button opens two event dialogs

mike55 asked 3 weeks ago

My calendar action handler opens a custom form, but the built in editor also appears. A separate toolbar button works correctly.

How can I suppress the default dialog?


Arkadiusz Idzikowski staff answered 3 weeks ago

The calendar output supplies an action wrapper. In that callback, call action.preventDefault() synchronously before opening your custom modal. Otherwise the calendar can continue with its own editor after your callback runs.

Keep the separate toolbar handler if you need it, but check that the calendar output is bound only once. If two dialogs still appear, please share the calendar template and complete add handler, and describe which action opens each dialog so we can reproduce the duplicate opening.

https://mdbootstrap.com/docs/angular/plugins/calendar/


mike55 commented 3 weeks ago

Moving preventDefault() to the start of the calendar callback fixed it. Only our custom editor opens now, and the separate toolbar button still works. I also checked the template and found just one binding. Thanks for pointing me to the action wrapper.


Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue
  • User: Free
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: MDB5 9.1.0
  • Device: Desktop
  • Browser: Edge
  • OS: macOS
  • Provided sample code: No
  • Provided link: No