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

Safari Animator.immediate bug #13

Open
illyas3 opened this issue May 19, 2020 · 0 comments
Open

Safari Animator.immediate bug #13

illyas3 opened this issue May 19, 2020 · 0 comments

Comments

@illyas3
Copy link

illyas3 commented May 19, 2020

Problem

When using Animator.immediate in Safari Mac OS, the animation doesn't happen. In the debug, there is a history of events, animation is created in the DOM, but does not render.

Problem occurs only in Safari (tested in Safari 11.0.1, Safari 12.1), while other browsers work okay.

Reproduce

Example 1 (elm + animator)

  1. Open Ellie in Safari on Mac OS.
  2. Click on the box.
    Expected behaviour: box goes back and forth on clicks.
    Wrong behaviour: box stays at the same place.

Example 2 (html, css only)

Link: jsFiddle

  • In Safari object stays in the coordinates 0, 0, 0
  • In other browsers in is in 0, 100, 0
  • If we change animation-duration: 0ms; to animation-duration: 1ms;, Safari renders it correctly, as all other browsers (at 0, 100, 0).

Additional info

  • Quick work around can be setting Animate.millis 1, which is pretty much the same, but produces animation-duration: 1ms in the css. This works, if you have only 1 animating object.
  • However, this fix does not address another scenario: If you are animating 2 or more objects (within the same Animator), and only first objects changes, the second object also changed (gets new Class + Keyframes). Class and Keyframes changes occur on all the objects within same Animator. And while for the first you can set Animate.millis 1 the second will automatically get animation-duration: 0ms, which will cause Safari to break animation of second object.

Working solution is to use different Animator for each animation, but then you have to have Tick Msg, Animator and subscription for each. Which is kinda against philosophy outlined in original announcement The Successor to Elm Style Animation.

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