-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Can't set type for input tag. #620
Comments
If you need this sort of functionality, I would recommend having multiple |
I think it only needs to be static if there's a two-way binding, because the change handler is dependent on the input type. In this case, I reckon it's fine for it to be dynamic. The error is being raised here because of this block — note the TODO comment (mea culpa). That check should probably be more specific and happen in the validation phase. |
only enforce static type if input is bound
This is fixed in 1.22.3, thanks |
Is it feasible to make For ex: <input
type={ passwordVisible ? 'text' : 'password'}
bind:value={data.loginForm.password} />
<span on:click={() => passwordVisible = !passwordVisible} class="fa fa-fw {passwordVisible ? 'fa-eye-slash' : 'fa-eye' }"></span> EDIT: Using svelte 3.6.7 |
I had thought there was an open issue already for that, but I can't find it right now. Because we don't want stuff to be completely dynamic at runtime, there'd be some restrictions on what you can do. Inputs with dynamic |
It significant confusing and it should be in the documentation. |
I am tring to generate input tag:
but svelte plugin output:
The text was updated successfully, but these errors were encountered: