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 7eab17c
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 19 deletions.
1 change: 1 addition & 0 deletions ember-autofocus-modifier/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
},
"dependencies": {
"@embroider/addon-shim": "^1.8.7",
"ember-lifeline": "^7.0.0",
"ember-modifier": "^4.1.0"
},
"devDependencies": {
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
38 changes: 27 additions & 11 deletions pnpm-lock.yaml

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

12 changes: 6 additions & 6 deletions test-app/config/ember-try.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,18 +101,18 @@ module.exports = async function () {
embroiderSafe({
npm: {
devDependencies: {
'@embroider/compat': '^3.2.1',
'@embroider/core': '^3.2.1',
'@embroider/webpack': '^3.1.5',
'@embroider/compat': '^3.3.0',
'@embroider/core': '^3.4.0',
'@embroider/webpack': '^3.2.1',
},
},
}),
embroiderOptimized({
npm: {
devDependencies: {
'@embroider/compat': '^3.2.1',
'@embroider/core': '^3.2.1',
'@embroider/webpack': '^3.1.5',
'@embroider/compat': '^3.3.0',
'@embroider/core': '^3.4.0',
'@embroider/webpack': '^3.2.1',
},
},
}),
Expand Down

0 comments on commit 7eab17c

Please sign in to comment.