Quantcast
Channel: Active questions tagged svelte - Stack Overflow
Viewing all articles
Browse latest Browse all 1541

error: 'type' attribute cannot be dynamic if input uses two-way binding

$
0
0

I was trying to create an Input component for my project. I want to set type attribute dyamically on input element

But when i set type attribute dynamically on input i get error saying'type' attribute cannot be dynamic if input uses two-way binding

So is there any workaround for this such that i can set type attribute dynamically without loosing two way binding

Input.svelte

<script>  export let placeholder = "";  export let label = "";  export let description = "";  export let value = "";  export let type = "text";</script><div class="container"><label>{label}</label><input {type} bind:value {placeholder} /><p>{description}</p></div>

Viewing all articles
Browse latest Browse all 1541

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>