Skip to content

Custom Mousetrap keyboard event filter

Erwan Rouchet requested to merge mousetrap-custom-filter into master

Closes #1242 (closed), #1245 (closed)

This is a good step towards supporting the Enter key, as is sometimes requested in various modals like on deletion #929.

A next step to make keyboard shortcuts much easier to implement in general would be to implement a more complex system, maybe by just using a different keyboard event library or writing our own, which would allow setting shortcuts on each Vue component:

export default {
  keyboard: {
    'm': 'loadMore',
    'enter': event => {
      this.submit()
    }
  }
}

It might be easier or more future-proof to write this using Vue 3 composables.

Merge request reports

Loading