Skip to content

Allow binding to custom elements #6484

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

Closed
redmagic opened this issue Jul 2, 2021 · 1 comment
Closed

Allow binding to custom elements #6484

redmagic opened this issue Jul 2, 2021 · 1 comment

Comments

@redmagic
Copy link

redmagic commented Jul 2, 2021

Describe the problem

I am unable to bind to properties created by web components.

For example https://component.kitchen/elix/ListBox exposes a value attribute, but svelte does not allow <elix-list-box bind:value={someVariable}>

Describe the proposed solution

Maybe this check can be controlled by a compiler flag e.g. allowUnvalidatedBindings.

Alternatives considered

Get the desired value through a custom event listener, like so: <elix-list-box on:selectedindexchange={(e) => (someVariable = e.target.value)}>

This feel convoluted though and not confirming to svelte's design.

Importance

would make my life easier

@geoffrich
Copy link
Member

Duplicate of #4838. There's discussion in that issue on how this should be implemented, since the current value binding works by listening to input and the correct event could vary depending on the web component implementation.

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

No branches or pull requests

3 participants