Skip to content

test repro issue when in shadow dom and renderInPlace#965

Closed
patricklx wants to merge 7 commits intoember-power-addons:masterfrom
patricklx:more-shadow-dom-tests
Closed

test repro issue when in shadow dom and renderInPlace#965
patricklx wants to merge 7 commits intoember-power-addons:masterfrom
patricklx:more-shadow-dom-tests

Conversation

@patricklx
Copy link
Copy Markdown

@patricklx patricklx commented May 23, 2025

repro

  • click on trigger -> it opens
  • click on something inside dropdown -> it stays open
  • click on trigger 2d time-> it opens
  • click on something inside dropdown -> it does NOT stay open

@patricklx patricklx changed the title test close & reopen more shadow dom tests May 23, 2025
@patricklx patricklx changed the title more shadow dom tests test repro issue when in shadow dom and renderInPlace May 23, 2025
@mkszepp
Copy link
Copy Markdown
Collaborator

mkszepp commented Jun 2, 2025

hmm... i have inside test-app a demo (http://localhost:4200/shadow-root), you can start demo with ember s shadowDom.
If i change this like in your test, it looks like it works 🤔

<BasicDropdown @renderInPlace={{true}} as |dropdown|>
  <dropdown.Trigger>Open me, i'm in shadow</dropdown.Trigger>
  <dropdown.Content>
    <div style="height: 100px; width: 100px; background: black"></div>
  </dropdown.Content>
</BasicDropdown>

The difference is that the element ember-basic-dropdown-content- has in route ember-basic-dropdown-content--left ember-basic-dropdown-content--below and in test there is ember-basic-dropdown-content-- ember-basic-dropdown-content--

@patricklx
Copy link
Copy Markdown
Author

patricklx commented Jun 2, 2025

@mkszepp
it has the same issue for me.

  • if i click first time it opens dropdown and i can click on div, it will not close

i close the dropdown and open again

  • now i click the div in dropdown and it does not stay open, it will close

@mkszepp
Copy link
Copy Markdown
Collaborator

mkszepp commented Jun 4, 2025

thanks for input... added a fix here #973

The issue was, that the rootElement removeEventListener wasn't working... Now we save the element on which we are adding the events and this solves this issue

mkszepp added a commit that referenced this pull request Jun 4, 2025
mkszepp added a commit that referenced this pull request Jun 4, 2025
* Fix removing event listener for shadow root element

* Add test from PR #965
@mkszepp
Copy link
Copy Markdown
Collaborator

mkszepp commented Jun 4, 2025

I have copied your test into the other PR... fix is released in v8.6.2... thanks for your help

@mkszepp mkszepp closed this Jun 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants