Skip to content

Commit

Permalink
refactor: use ember-lifeline to avoid eslint error
Browse files Browse the repository at this point in the history
  • Loading branch information
uanjoze committed Sep 18, 2024
1 parent afb19d4 commit f154b0f
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 6 deletions.
1 change: 1 addition & 0 deletions ember-autofocus-modifier/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/parser": "^8.6.0",
"concurrently": "^8.2.2",
"ember-lifeline": "^7.0.0",
"ember-template-lint": "^5.13.0",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
Expand Down
4 changes: 2 additions & 2 deletions ember-autofocus-modifier/src/modifiers/autofocus.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { modifier } from "ember-modifier";
import { next } from "@ember/runloop";
import { runTask } from "ember-lifeline";

const focusableElements = [
"BUTTON",
Expand Down Expand Up @@ -68,7 +68,7 @@ const autofocus = modifier<ModifierArgs>(function autofocus(
element.setAttribute("tabindex", "-1");
}

next(function () {
runTask(element, function () {
targetElement.focus();
});

Expand Down
24 changes: 20 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f154b0f

Please sign in to comment.