-
Notifications
You must be signed in to change notification settings - Fork 0
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
Floating label state #3
Comments
Thank you for filing! https://codepen.io/anton-kachurin/pen/BdKJpe Seems like you're describing this scenario (see the pen above). In the latest Firefox, Chrome, and Edge it's working fine, i.e. the floating label floats when necessary. Could you provide more specific conditions (OS, browser, etc.) under which this behavior fails? You can use this pen as a template. Underlying MDC-Web library is responsible for handling this case. On this line, it adds a special class to the component if the input isn't empty. I can submit an issue (and probably a PR too) to MDC-Web as soon as I have this bug reproduced. |
Thanks for getting back to me. Here is a pen to illustrate the problem: https://codepen.io/rsuk/pen/NvRerO It is something I had hit with mdl too. I'm guessing that MDC doesn't get the right notifications when the field is updated through a knockout binding after the initial configuration. |
Thank you for the comprehensive illustration. You're correct, the core As a workaround, the That's just a throw together, though. Please let me know if you need any help with implementing a real binding. |
I've submitted a PR solving this issues in the core component. Will rebuild this library after the changes get into a release. |
I'm really interested in leveraging your library to reduce the amount of markup I need to implement Material Components for Web. I use knockout for data binding the control values, so I am doing this:
.. which is working great. I'm guessing I'm doing this the right way - including what would normally be in data-bind in the params attribute? The problem I'm seeing is that the floating label isn't floating when the page and value is first loaded through the binding. If I delete the text and type the label floats. I suspect this might not be an issue specific to your library, but wondered if you have found a way to get around this - so the label is floated if the control contains text set through a ko binding.
The text was updated successfully, but these errors were encountered: