LukaszWatroba / v-accordion

Multi-level accordion component for AngularJS.
http://lukaszwatroba.github.io/v-accordion
MIT License
310 stars 100 forks source link

Disable keyboard controls #48

Open shubhamsinha92 opened 8 years ago

shubhamsinha92 commented 8 years ago

Hey,

I was wondering if there is any way I could disable the keyboard controls for the v-pane. Currently when I press the space key it expands or collapses the pane. I would like to disable this feature if that's possible.

LukaszWatroba commented 8 years ago

Hey,

For now, it's not possible (at least without using dirty hacks) but I'll try to include it the next release.

shubhamsinha92 commented 8 years ago

Sounds good. Any suggestions for the dirty hacks?

LukaszWatroba commented 8 years ago

You can do something like this:

myApp.directive('vPaneHeader', function () {
  return {
    restrict: 'E',
    priority: 1,
    link: function (scope, iElement) {
      iElement.off('keydown');
    }
  }
});