Closed abyx closed 7 years ago
Hi @abyx, thanks for pointing that out. I believe it's related to #243
I would appreciate a PR.
The fix was made in regards to the scrolling to top #59 and it was done in this commit https://github.com/leocaseiro/angular-chosen/commit/8b7e137f458f26fd643317cfa1102b7ccde5b238
I would need a better solution for fixing that issue. However, I see this issue and the #243 is a priority for most of the users.
My intuition is that we should remove the overwritten ngModel.render
and the CSS hack and instead add something like:
ngModel.$formatters.push(function(value) {
initOrUpdate()
return value
})
The idea is that formatters are called only when angular changes the expression, while ngModelCtrl.render()
is called both when angular chances it, and when chosen changes it
This is just a guess off the top of my head, haven't had the chance to think through it very deeply.
Same :+1:
So, are you guys saying we should just ignore whatever that line was trying to fix? If so I'll send a PR.
Hi @abyx, thanks for your keep up.
I would be very happy if the PR fixes the ngModel
issue as well as keeping the chosen opened while holding the cmd on Mac or ctr on PC.
Thanks
Opened pull request #245 will appreciate feedback
Please make sure you can mark all the options, before open this Issue. I'll prioritise the issues that are consistent and completed.
Please, post your plunker link here:
Write your issue:
As can be seen in the attached plunker, clicking the button, which updates the model value, does not result in chosen itself getting re-rendered. This seems to be because of this line in the code. At least when I'm looking at it, the
.css()
call always returns a value of0px
, even when the dropdown is closed, which prevents the updated event from getting triggered.I have no problem creating a PR, but I'm just not sure what that line of code is trying to accomplish. Would it be enough to test whether the dropdown is open (e.g. by checking if the active class is applied)?