Skip to content

lib/web/mage/dropdowns.js fails when autoclose is set to true #15469

@brian-labelle

Description

@brian-labelle

Magento's lib/web/mage/dropdowns.js has a bug that prevents a developer from specifying autoclose: false as an option for the dropdown function.

Preconditions

  1. Magento 2.2 or greater
  2. Any version of PHP, MySQL
  3. Any Browser

Steps to reproduce

  1. Call function 'dropdown' on a jquery element, specifying 'autoclose: false' as an option
$(this.selector).dropdown({
    autoclose: false
});
  1. Open the dropdown
  2. Click anywhere inside the dropdown content

Expected result

  1. The dropdown should remain open

Actual result

  1. Console error indicating we cannot call function hasClass on undefined
    1. el is undefined

Metadata

Metadata

Assignees

No one assigned

    Labels

    Fixed in 2.2.xThe issue has been fixed in 2.2 release lineFixed in 2.3.xThe issue has been fixed in 2.3 release lineIssue: Format is validGate 1 Passed. Automatic verification of issue format passedProgress: PR CreatedIndicates that Pull Request has been created to fix issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions