open-nomad/ui/app/modifiers/autofocus.js
2023-04-10 15:36:59 +00:00

13 lines
269 B
JavaScript

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/
import { modifier } from 'ember-modifier';
export default modifier(function autofocus(element, _positional, named) {
const { ignore } = named;
if (ignore) return;
element.focus();
});