aos icon indicating copy to clipboard operation
aos copied to clipboard

Duration of 0 set through data attributes gets default behavior

Open ThinkByDesign opened this issue 2 years ago • 0 comments

This is:

  • Bug

Specifications

  • AOS version:
  • OS: MacOS 12.3.1
  • Browser: Safari 15.4, Vivaldi 5.3.2679.70, and couple of Chrome browsers but don't know specific versions

Expected Behavior

When animation duration is set to 0, animation should happen immediately

Actual Behavior

When animation duration is set to 0, appears to revert to whatever default was set (250ms?)

Steps to Reproduce the Problem

  1. on an element, set data-aos-duration="0"
  2. Run AOS.init()
  3. Observe that it animates with the default duration
  4. (workaround) Run AOS.init({duration: 0})
  5. Observe that it behaves as expected

Detailed Description

My guess is that the code is doing a boolean check to see whether or not a value is set - and a value of 0 comes up as false. Probably just needs to do a more detailed check? (Apologies, I'm under a deadline and just don't have the time to trace through code and validate my hypothesis.)

Possible Solution

Hopefully it's as easy as checking for the presence of a non-false 0 value.

ThinkByDesign avatar Aug 26 '22 15:08 ThinkByDesign