mattlewis92 / angular-bootstrap-calendar

A port of the bootstrap calendar widget to AngularJS (no jQuery required!)
https://mattlewis92.github.io/angular-bootstrap-calendar/
MIT License
798 stars 369 forks source link

Prevent !!vm.onDateRangeSelect from executing on right mouse click in calendarHourList.html #575

Closed bwobbones closed 7 years ago

bwobbones commented 7 years ago

Bug description / Feature request:

I have a custom calendarHourList.html that also contains a right click context menu (via angular-boostrap-contextmenu).

When I right click in a cal-day-hour-part in chrome 57 on windows (note not on a mac!) it fires both oncontextmenu and onclick events which means that !!vm.onDateRangeSelect is executed unexpectedly and I get both the handler for the context menu and the handler for the left click.

Any ideas on how to prevent the !!vm.onDateRangeSelect function firing?

The context menu works when you right click on an event though, so I guess I need to use whatever mechanism that does to swallow the ng-click for right click events?

Versions

Angular: 1.5.9

Calendar library: latest

Browser name and version: Chrome 57 on Windows

mattlewis92 commented 7 years ago

I think if you do oncontextmenu="$event.stopPropagation();" it should prevent the handler from firing. Hope that helps!