Skip to content

Commit 40bf920

Browse files
authored
Merge pull request #468 from appuniversum/chore/remove-ember-auto-focus
Replace the `@zestia/ember-auto-focus` addon with a simple custom modifier
2 parents 39582d5 + 2973d1d commit 40bf920

File tree

3 files changed

+7
-243
lines changed

3 files changed

+7
-243
lines changed

addon/components/au-accordion.gjs

+6-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ import { on } from '@ember/modifier';
99
import { action } from '@ember/object';
1010
import Component from '@glimmer/component';
1111
import { tracked } from '@glimmer/tracking';
12-
import autoFocus from '@zestia/ember-auto-focus/modifiers/auto-focus';
12+
import { modifier } from 'ember-modifier';
13+
14+
const autofocus = modifier(function autofocus(element) {
15+
element.focus();
16+
});
1317

1418
export default class AuAccordion extends Component {
1519
@tracked isOpen = false;
@@ -96,7 +100,7 @@ export default class AuAccordion extends Component {
96100
</Group>
97101
</AuToolbar>
98102
{{#if this.isOpen}}
99-
<AuContent {{autoFocus}} tabindex="0" data-test-accordion-content>
103+
<AuContent tabindex="0" data-test-accordion-content {{autofocus}}>
100104
{{#if this.loading}}
101105
<AuLoader data-test-accordion-loader />
102106
{{else}}

package-lock.json

-239
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
},
7979
"overridesComments": {
8080
"@glimmer/validator and util": "https://github.com/emberjs/ember.js/issues/20502",
81-
"ember-source": "storybook/ember, zestia/auto-focus and focus-trap all depend on ember-source peerDeps that don't match all our test scenarios"
81+
"ember-source": "storybook/ember and focus-trap all depend on ember-source peerDeps that don't match all our test scenarios"
8282
},
8383
"dependencies": {
8484
"@babel/core": "^7.23.2",
@@ -87,7 +87,6 @@
8787
"@floating-ui/dom": "^1.1.0",
8888
"@glimmer/component": "^1.1.2",
8989
"@glimmer/tracking": "^1.1.2",
90-
"@zestia/ember-auto-focus": "^5.1.0",
9190
"ember-auto-import": "^2.6.3",
9291
"ember-cli-babel": "^8.2.0",
9392
"ember-cli-htmlbars": "^6.3.0",

0 commit comments

Comments
 (0)