import Component from '@glimmer/component'; import { tracked } from "@glimmer/tracking"; import { action } from "@ember/object"; export default class SortableGroupAccessibleComponent extends Component { @tracked selectedIndex = 0; @tracked groupHasFocus = false; @action handleFocus() { this.groupHasFocus = true; } @action handleBlur() { this.groupHasFocus = false; } @action handleArrowUp() { if (this.selectedIndex > 0) { this.selectedIndex -= 1; } } @action handleArrowDown() { if (this.selectedIndex < this.args.models.length - 1) { this.selectedIndex += 1; } } preventDefault(evt) { evt.preventDefault(); } }