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

fix(reorder-group): synchronize reordering with style update #25669

Closed
wants to merge 1 commit into from

Conversation

dan-rp1
Copy link
Contributor

@dan-rp1 dan-rp1 commented Jul 21, 2022

closes #21182

  • Bugfix

What is the current behavior?

In the function completeSync(), in the reorder-group component:

When used in Firefox, the most recently set value of the translateY css property is applied to the selectedItemEl variable and rendered visually before the cleared transform property is rendered. This creates the appearance of a "double" animation as the element jumps out of place and slides to its final location.

Issue URL: #21182

What is the new behavior?

The reorder operation and the update to the style property are moved to the next turn of the event loop by setTimeout (with default of 0 delay), which causes Firefox to render them in the expected way (no jumping of the selected element).

Does this introduce a breaking change?

  • Yes
  • No

@dan-rp1 dan-rp1 requested a review from a team as a code owner July 21, 2022 21:28
@github-actions github-actions bot added the package: core @ionic/core package label Jul 21, 2022
@sean-perkins
Copy link
Contributor

Thanks for this PR @dan-rp1. Couple items that will need to be addressed so that our team can consider it:

  1. We avoid using setTimeout as a mechanism for delaying rendering (unless as a feature designed to operate after a specific duration). Can you try with our raf utility instead and see if waiting for the next available frame resolves the issue instead?
  2. The original issue does not have a reproduction app to test against. We will need a reproduction app to confirm these changes function as expected.
  3. Due to the nature of this bug, a test covering the expected behavior would be good to add here.

Let me know if you have any questions!

@liamdebeasi
Copy link
Contributor

liamdebeasi commented Nov 21, 2022

Thank you very much for the PR! We appreciate your contribution to Ionic Framework. I developed another solution that uses a requestAnimationFrame rather than a setTimeout which should help make sure that the DOM manipulation and the transform update happens in the same frame. I am going to close this PR in favor of #26326, but I will be sure to give you co-author credit if the PR is merged. Let me know if you have any questions.

@dan-rp1
Copy link
Contributor Author

dan-rp1 commented Nov 22, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: core @ionic/core package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: IonReorder items animate twice in Firefox
3 participants