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

[🐛 in esl-toggleable]: incorrect activator passed if out of the box close trigger has complex structure #1852

Closed
ala-n opened this issue Aug 8, 2023 · 0 comments · Fixed by #1853
Assignees
Labels
bug Something isn't working released

Comments

@ala-n
Copy link
Collaborator

ala-n commented Aug 8, 2023

To Reproduce
Steps to reproduce the behavior:

  1. Use the esl-togglable (or ESLToggleable-based) component with the following structure
  <esl-toggleable close-on=".btn">
      <button type="button" class="btn">
         <div>Close</div>
      </button>
  </esl-togglable>
  1. Handle hide event:
 $togglable.addEventListener('esl:hide', (e) => {
    console.log(e.details.activator);
 });
  1. Click on "Close" button
  2. Observe passed activator

Current behavior
The current activator is equal e.target (which is nested div in that case)

Expected behavior
The activator should be equal to the marked actionable element .btn in that case

@ala-n ala-n added the bug Something isn't working label Aug 8, 2023
@ala-n ala-n self-assigned this Aug 8, 2023
@ala-n ala-n added this to the ⚡ESL: 4.10.0 Minor release milestone Aug 8, 2023
ala-n added a commit that referenced this issue Aug 10, 2023
…lose

fix(esl-toggleable): fix activator when close-on inner trigger click handled (#1852)
ala-n pushed a commit that referenced this issue Aug 10, 2023
# [4.10.0](v4.9.4...v4.10.0) (2023-08-10)

### Bug Fixes

* **esl-footnotes:** shape to support TSX is missing in module ([fd8cd07](fd8cd07))
* **esl-togglable:** open attribute change behavior ([826b27b](826b27b))
* **esl-toggleable:** fix activator when close-on inner trigger click handled ([#1852](#1852)) ([f450d8b](f450d8b))
* **esl-utils:** fix unhandled rejection when deferred is rejected but actual promise was not requested ([#1839](#1839)) ([5e111ba](5e111ba))

### Features

* **esl-toggleable:** change `closeOnEsc` and `closeOnOutsideAction` mappers to extended boolean ('0' and 'false' values now considered as falsy) ([181a2b7](181a2b7))
* **esl-trigger:** change `ignoreEsc` mapper to extended boolean ('0' and 'false' values now considered as falsy) ([9ccee3d](9ccee3d))
* **esl-utils:** `lockScroll` / `unlockScroll` methods reworked with no-scroll detection ([25b5b91](25b5b91))
* **esl-utils:** create `toBooleanAttribute` and create extended boolean attribute flow ([e039256](e039256))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants