Closed kushal9291 closed 4 years ago
I'm having this issue, as well.
Can someone confirm if there is a fix available for this, please?
Try to add the "has-value" class to the parent of the input.
Negligible, almost no performance hit, as the code checks to see if the plugin is already attached to the element and doesn't attach another if present. Calling the plugin again triggers the change
event on the controls, so you could also just call $('.floating-label .custom-select, .floating-label .form-control').trigger('change');
with the same effect.
Hi all,
I don't think there is a "perfect" solution if you cannot trigger the change
event when the value is changed (e.g. if you cannot modify the code of an existing application). However running .floatinglabel()
every 100ms should not cause you major problems. Alternatively, you can also manually trigger change
event as @mikemccaughan pointed out.
In the future, we are looking at getting rid of JavaScript dependency for floating label component using :placeholder-shown
(https://drafts.csswg.org/selectors-4/#placeholder). However this is still a working draft. Current browser support is here.
Hi, I have web application in which form values are changed through JavaScript. When the value is changed with JS, floating label doesn't work. As it's an existing application I can't trigger function for floating label when a value is changed with JavaScript. so to get around this issue I did this.
I want to know if it will lead to any performance issue or not. Thanks