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

AnimatedContainer motion argument is incomplete #85

Open
jeffdaley opened this issue Oct 18, 2023 · 0 comments
Open

AnimatedContainer motion argument is incomplete #85

jeffdaley opened this issue Oct 18, 2023 · 0 comments

Comments

@jeffdaley
Copy link

jeffdaley commented Oct 18, 2023

Hello and thank you all for the hard work 🙏

It seems the <AnimatedContainer>'s motion argument also accepts an extended Motion class. Here's my configuration:

import Component from "@glimmer/component";
import { Resize } from "ember-animated/motions/resize";
import { easeOutExpo } from "app/utils/ember-animated/easings"; // custom

class CustomResize extends Resize {
  // Resize extends Motion<Options>
  *animate() {
    this.opts.easing = easeOutExpo;
    this.opts.duration = 750;
    yield* super.animate();
  }
} 

export default class CustomComponent extends Component {
   customMotion = CustomResize;
}

<template>
  <AnimatedContainer @motion={{this.customMotion}}>
      ...
   </AnimatedContainer>
</template>

It might be a hack (?) but if not, it would be nice to see it covered in the Glint type.

Thanks for considering it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant