Skip to content

Accordion widget buggy transition #24807

@BezV8

Description

@BezV8

When using the code sample from https://devdocs.magento.com/guides/v2.3/javascript-dev-guide/widgets/widget_accordion.html for an accordion widget - but setting the animate property to a numeric value - the transition works correctly for individual collapse elements, but when clicking to open a closed element the currently open element closes instantaniously without a transition.

Preconditions (*)

  1. Magento 2.3.2 & 2.3-develop

Steps to reproduce (*)

  1. Add an accordion widget to any page using the code sample from https://devdocs.magento.com/guides/v2.3/javascript-dev-guide/widgets/widget_accordion.html
  2. Assign a numeric value to the 'animate' option e.g. "animate": {"duration": 600}
    Using the following HTML for the accordion:
<div id="accordion" data-mage-init='{
        "accordion":{
            "collapsible": true,
            "openedState": "active",
            "openOnFocus": true,
            "animate": {"duration": 600}
        }}'>
  <div data-role="collapsible">
    <div data-role="trigger">
      <h4>Title 1</h4>
    </div>
  </div>
  <div data-role="content">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s</div>
  <div data-role="collapsible">
    <div data-role="trigger">
      <h4>Title 2</h4>
    </div>
  </div>
  <div data-role="content">It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</div>
  <div data-role="collapsible">
    <div data-role="trigger">
      <h4>Title 3</h4>
    </div>
  </div>
  <div data-role="content">Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old.</div>
</div>
  1. Open a closed element and observe the transition of both it and the currently open element.

Expected result (*)

  1. Both elements transition according to the time set in the animate property.

Actual result (*)

  1. The element being clicked or focused transitions according to the animate property
  2. The currently open element closes instantly causing a jerky transition.
    accordion

Metadata

Metadata

Assignees

Labels

Component: WidgetIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentReproduced on 2.3.xThe issue has been reproduced on latest 2.3 release

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions