adopted-ember-addons / adopted-ember-addons/ember-keyboard
Deprecation error with simple keyboard shortcut implementation
- Vorherrschende Sprache
- JavaScript
- Sterne
- 177
- Forks
- 59
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
I implemtented two simple keyboard shortcuts in my app:
```
{{on-key 'ctrl+m' this.toggleVisibility}}
{{on-key 'ctrl+b' this.toggleVisibility}}
```
These toggle the visibility of something:
```
import Component from '@glimmer/component';
import { tracked } from '@glimmer/tracking';
import { action } from '@ember/object';
export default class styleguideComponent extends Component {
@tracked visibility = true;
@service router;
@action
toggleVisibility() {
this.visibility = !this.visibility
}
}
```
However, I get a long depreciation [stack trace](https://gist.github.com/Wolfr/cdaa8acc78ab9ff5a1c908b1e6c761a6) . I think I used the latest syntax as documented [here](http://adopted-ember-addons.github.io/ember-keyboard/usage).
If I remove the 2nd shortcut, I don't get the stack trace. However, it is recommended in the docs to do it this way for multiple shortcuts.
Would anyone have an idea why I am getting this stack trace? I loved the simplicity of this package btw.
Beitragsleitfaden
Bewertung
Dieses Issue wurde noch nicht bewertet.