Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace the @zestia/ember-auto-focus addon with a simple custom modifier #468

Merged
merged 1 commit into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions addon/components/au-accordion.gjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ import { on } from '@ember/modifier';
import { action } from '@ember/object';
import Component from '@glimmer/component';
import { tracked } from '@glimmer/tracking';
import autoFocus from '@zestia/ember-auto-focus/modifiers/auto-focus';
import { modifier } from 'ember-modifier';

const autofocus = modifier(function autofocus(element) {
element.focus();
});

export default class AuAccordion extends Component {
@tracked isOpen = false;
Expand Down Expand Up @@ -96,7 +100,7 @@ export default class AuAccordion extends Component {
</Group>
</AuToolbar>
{{#if this.isOpen}}
<AuContent {{autoFocus}} tabindex="0" data-test-accordion-content>
<AuContent tabindex="0" data-test-accordion-content {{autofocus}}>
{{#if this.loading}}
<AuLoader data-test-accordion-loader />
{{else}}
Expand Down
239 changes: 0 additions & 239 deletions package-lock.json

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

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
},
"overridesComments": {
"@glimmer/validator and util": "https://github.com/emberjs/ember.js/issues/20502",
"ember-source": "storybook/ember, zestia/auto-focus and focus-trap all depend on ember-source peerDeps that don't match all our test scenarios"
"ember-source": "storybook/ember and focus-trap all depend on ember-source peerDeps that don't match all our test scenarios"
},
"dependencies": {
"@babel/core": "^7.23.2",
Expand All @@ -87,7 +87,6 @@
"@floating-ui/dom": "^1.1.0",
"@glimmer/component": "^1.1.2",
"@glimmer/tracking": "^1.1.2",
"@zestia/ember-auto-focus": "^5.1.0",
"ember-auto-import": "^2.6.3",
"ember-cli-babel": "^8.2.0",
"ember-cli-htmlbars": "^6.3.0",
Expand Down
Loading