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

ld-select doesn't work when embedded inside a custom element #450

Closed
dpitois opened this issue Dec 8, 2022 · 1 comment · Fixed by #451
Closed

ld-select doesn't work when embedded inside a custom element #450

dpitois opened this issue Dec 8, 2022 · 1 comment · Fixed by #451
Assignees
Labels
bug An issue describing unexpected or malicious behaviour. confirmed This label indicates that the issue has been reproduced and verified by the core team. released

Comments

@dpitois
Copy link

dpitois commented Dec 8, 2022

Bug description

We are using the Liquid elements to build custom elements using Preact and publish them with ViteJS as library.
When designing the component without packaging it as a library, the <ld-select /> behavior seems fine.
We are wrapping our component using shadow root element open, our goal is to keep each custom element isolated from other one, as a fallback we can omit that shadow root but as a result other elements on our pages are messed with styles*.
(* style messing is not illustrated in the below repro-sandbox)

Steps to reproduce the behavior

Repro codesandbox: https://codesandbox.io/p/github/dpitois/liquid-selects/

  1. Go to the repro sandbox
  2. Click on any of the selects from the Preact app section, the options are display
  3. Click on any of the selects from the Preact custom element section, the options are not display

Note: we try to use Liquid elements as web component and with React bindings

  • src/component/Custom.tsx uses Liquid with direct import of web component
  • src/component/CustomReact.tsx uses Liquid React bindings

Expected behavior

When wrapping Liquid elements inside custom elements the options should be display

Actual behavior

Options seem to be created in the DOM but the popper does not display them when wrapped inside a custom element.

Screenshots

ld-select used inside a Preact app (bootstraped with ViteJS)
image

ld-select used inside a Preact custom element (bootstraped with ViteJS)
image

Details about device, OS, browser (including versions)

  • Device: Windows PC
  • OS: Windows 10
  • Browser: Chrome
  • Version: 108

We can move the reported issue as a Github discussion or Teams conversation, with internal tools we might give more specific context about the use case and how we reach the issue.

@borisdiakur borisdiakur added bug An issue describing unexpected or malicious behaviour. confirmed This label indicates that the issue has been reproduced and verified by the core team. in progress This label indicates that the issue is currently being worked on. labels Dec 11, 2022
@borisdiakur borisdiakur self-assigned this Dec 12, 2022
github-actions bot pushed a commit that referenced this issue Dec 12, 2022
## [4.1.11](v4.1.10...v4.1.11) (2022-12-12)

### Bug Fixes

* **ld-select:** use event composed path in closest for click outside detection ([d287b0d](d287b0d)), closes [#450](#450)
* **ld-tooltip:** keep tooltip with trigger type click open on click inside ([5d90ebe](5d90ebe))
@borisdiakur
Copy link
Contributor

🎉 This issue has been resolved in version 4.1.11 🎉

The release is available on:

Your semantic-release bot 📦🚀

@borisdiakur borisdiakur added released done and removed in progress This label indicates that the issue is currently being worked on. labels Dec 12, 2022
borisdiakur pushed a commit that referenced this issue Dec 14, 2022
## [4.1.11](v4.1.10...v4.1.11) (2022-12-12)

### Bug Fixes

* **ld-select:** use event composed path in closest for click outside detection ([d287b0d](d287b0d)), closes [#450](#450)
* **ld-tooltip:** keep tooltip with trigger type click open on click inside ([5d90ebe](5d90ebe))
borisdiakur pushed a commit that referenced this issue Jan 5, 2023
## [4.1.11](v4.1.10...v4.1.11) (2022-12-12)

### Bug Fixes

* **ld-select:** use event composed path in closest for click outside detection ([d287b0d](d287b0d)), closes [#450](#450)
* **ld-tooltip:** keep tooltip with trigger type click open on click inside ([5d90ebe](5d90ebe))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An issue describing unexpected or malicious behaviour. confirmed This label indicates that the issue has been reproduced and verified by the core team. released
Projects
None yet
2 participants