-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Fix issue with the sizing of the text input field #712
Conversation
… of the input control is dynamically toggled, for example via the `ng-disabled` attribute on the `<ui-select>` element. The problem is caused by the width calculation getting an incorrect 0 `offsetLeft` value for the input, as the `offsetParent` of the input is still `null` when the controller tries to calculate the width. The fix resolves this by adding a watch for the `offsetParent`, and only performing the width calculation when both the `offsetParent` *and* the container width are available.
Of course, |
…g the use of the `$scope.$watchGroup` API.
…ed state changes.
Here's an updated Plunk: |
Fix issue with the sizing of the text input field
I'm getting failed tests when running new master with this PR merged. From Travis looks ok, but from my laptop I get these fails: @brianfeister @cmlenz can you reconfirm if you get the same failed tests? |
@brianfeister can you reconfirm that you are in master branch and with the last commit pulled? |
Something is wrong with your local environment, I think. Here is me resetting to the merged commit and running the tests, where all pass:
|
Also keep in mind that both Travis and my local environment are agreeing that the tests pass Sent from my iPhone
|
@brianfeister yes, for some weird reason I was having this issue but removing bower_components folder and running |
@cmlenz , please, take a look at bootstrap .form-inline. Placeholder doesn't fit into input. |
Fix issue with the sizing of the text input field when the visibility of the input control is dynamically toggled, for example via the
ng-disabled
attribute on the<ui-select>
element.The problem is caused by the width calculation getting an incorrect 0
offsetLeft
value for the input, as theoffsetParent
of the input is stillnull
when the controller tries to calculate the width. The fix resolves this by adding a watch for theoffsetParent
, and only performing the width calculation when both theoffsetParent
and the container width are available.I've created a Plunk to demonstrate the issue:
http://plnkr.co/79Ajy18oWP88EopEKAmn
And here's the same example, but with the patch applied:
http://plnkr.co/KdsdBldLBwLRfojjWY24
I've reproduced the problem in Safari, Chrome, Firefox, and IE. The fix works in all of them.