Conversation
|
@nickschot and I went on a wild chase Even though this "fixes" the issue, it most likely does so by covering up the actual problem while also introducing a lot of moving parts. My initial assumption that Quoting MDN (emphasis by me):
We want to make sure, that janking the model component still triggers all necessary parts, but we shouldn't do so by introducing timers. Instead #686 is most likely one of the problems behind #665 I'm keeping this PR open for reference until #665 is resolved. |
55caf58 to
62d6742
Compare
|
Is anything blocking this currently? All of the referenced issues have been merged/closed. |
9cda4c3 to
6919dfa
Compare
6919dfa to
e52b635
Compare
|
I've rebased and refactored to match the latest iteration, hoping to get this in with the next release. |
There was a problem hiding this comment.
Pull Request Overview
Enables and documents a new onAnimationModalInEnd callback for opening animations, updates the modal component to invoke it, and adds an integration test to verify its invocation.
- Introduce
onAnimationModalInEndoption in modal API, component, and docs - Update
EpmModalto expose and invoke the new callback - Add an integration test and adjust helpers/mocks to support animation callbacks
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/test-app/tests/integration/components/modal-test.js | Add a test for onAnimationModalInEnd and onAnimationModalOutEnd callbacks |
| packages/test-app/tests/helpers/mocks.js | Extend the default mock modal to support a click-to-close action |
| packages/test-app/tests/application/basics-test.js | Remove obsolete sinon-based animation-start test |
| packages/ember-promise-modals/src/components/epm-modal.js | Add an options getter and invoke the new onAnimationModalInEnd callback |
| packages/ember-promise-modals/src/components/epm-modal.hbs | Update class binding to use options.className |
| packages/ember-promise-modals/README.md | Document the new onAnimationModalInEnd hook |
| README.md | Document the new onAnimationModalInEnd hook in the root README |
| @@ -1,4 +1,4 @@ | |||
| import { render, settled, waitFor } from '@ember/test-helpers'; | |||
| import { click, render, settled, waitFor } from '@ember/test-helpers'; | |||
There was a problem hiding this comment.
[nitpick] The click import is never used in this test. Remove it or add a click step to exercise the mock’s close button.
| this.args.modal._remove(); | ||
| } | ||
|
|
||
| this.options.onAnimationModalInEnd?.(animationName); |
There was a problem hiding this comment.
This calls the "in end" callback for all animations, including the closing animation. It should only fire when the modal’s opening animation ends, and onAnimationModalOutEnd should be invoked for closing animations.
| this.options.onAnimationModalInEnd?.(animationName); | |
| if (isOutAnimation) { | |
| this.options.onAnimationModalOutEnd?.(animationName); | |
| } else { | |
| this.options.onAnimationModalInEnd?.(animationName); | |
| } |
| this.options.onAnimationModalInEnd?.(animationName); | ||
| }; | ||
|
|
||
| if (this.element) { |
There was a problem hiding this comment.
[nitpick] An animationend listener is added but never removed. Consider cleaning it up (e.g., in a willDestroy hook) to prevent memory leaks when the component is destroyed.
Closes #637