You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the ng-model value is initialized after the placeholder directive (but in the same digest cycle), the value is hidden, and the placeholder is displayed instead.
see https://jsfiddle.net/7arxneod/6/ If you watch closely, the value will flicker between the expected value ($1.00) and 'placeholder' in ie9.
The issue seems to be the initialization of the placeholder. Since the placeholder directive's link function executes first, updateValue() will update the elements value in the next digest cycle to an empty string.
When the other directives link function initializes the value, the $render() function will correctly set the element's value, but because updateValue() uses $timeout, the displayed value is overridden in the next digest cycle.
The text was updated successfully, but these errors were encountered:
Hey @acidaris I can confirm this bug. Your deduction was correct. That $timeout you mentioned is part of a workaround for a bug in angular core where tabbing out of an input triggers a delayed update to the model.
I've got a fix working locally. I updated updateValue() so that it's smarter about when it uses $timeout. I'll push this soon.
If the ng-model value is initialized after the
placeholder
directive (but in the same digest cycle), the value is hidden, and the placeholder is displayed instead.see https://jsfiddle.net/7arxneod/6/ If you watch closely, the value will flicker between the expected value ($1.00) and 'placeholder' in ie9.
The issue seems to be the initialization of the
placeholder
. Since theplaceholder
directive'slink
function executes first,updateValue()
will update the elements value in the next digest cycle to an empty string.When the other directives link function initializes the value, the
$render()
function will correctly set the element's value, but becauseupdateValue()
uses$timeout
, the displayed value is overridden in the next digest cycle.The text was updated successfully, but these errors were encountered: