-
Notifications
You must be signed in to change notification settings - Fork 233
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
fix(Input): Use a reactive spread instead of custom action to set Input type
attribute
#921
fix(Input): Use a reactive spread instead of custom action to set Input type
attribute
#921
Conversation
Run & review this pull request in StackBlitz Codeflow. |
The latest updates on your projects. Learn more about Vercel for Git βοΈ
|
border
class to Input defaultClasstype
attribute
type
attributetype
attribute
type
attributetype
attribute
That's a neat trick. Let's use it. Please approve. |
Wouldn't this change make sense for FloatingLabelInput.svelte too? The same custom action is used there that was replaced here. |
Yes, it would. @Not-Jayden can you make the same change at |
Done :) #927 |
π Description
Adjust the way the type attribute is set to use a reactively spread object rather than a custom action to circumvent the svelte warning. The motivation for this change is that currently the border is dependent on a
type
attribute being set on the input, which gets its styling from the global Flowbite CSS file.This causes a brief flicker in the input's border given the attribute is being set with javascript after it first mounts, and just doesn't render a border at all if JS is disabled.
With the reactive spread, the input does have the type attribute already set on mount so the border will be present even without JS.
Status
β Checks
βΉ Additional Information
Also not sure if the border class should just be added in the defaultClass as well, but this is a less breaking change.