Skip to content

No delay when transition duration is 0 #35982

@yezhizhen

Description

@yezhizhen

Describe the bug:
No delay when transition duration is 0

To Reproduce:
Click first button, then second. There should be a delay of 2 seconds, then instantly jump to translateY(0).

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <button id="first">first step</button>
    <button id="resetanimation">reset animation instantly with delay</button>
    <div id="target" style="width: 100px; height: 100px; background-color: aqua;"></div>
    <script>
        var target = document.getElementById("target");
        first.onclick = function() {
            target.style.transform = "translateY(100px)";
            target.style.transition = "transform 7s ease-out";
        }

        resetanimation.onclick = function() {
            target.style.transform = "translateY(0)";
            target.style.transition = "transform 0s ease-out 2s";
        }
    </script>
</body>
</html>

Platform:
All

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-untriagedNew issues that haven't been triaged yet

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions