-
Notifications
You must be signed in to change notification settings - Fork 27.5k
maxlength issue in 1.3.0 beta 15 (invalid -> valid) #8234
Comments
Can you please provide a reproduction in a plnkr.co or similar? |
Hi, |
just tried this on saucelabs and I'm not seeing the issue? (I did modify the plunk to use ng-maxlength rather than maxlength though, because browsers will tend to not allow you to enter more characters than the actual maxlength attribute value). |
I checked on IE11, I see the issue, and it's truly confusing. Also, the flash appears first in beta.12, which is when the validator refactoring was introduced. I remember there was a bug with ng-maxlength and initial validation, maybe that is related. It's pretty strange though that only the input in ngRepeat is affected |
Hi @caitp , |
@Narretz I jumped from 11 to 15, quickly checked that it was reworked from the sources, but didn't check since which version :) but yeah, apparently you found it too :) I'm staying with beta11 meanwhile, otherwise I have massive red blinking on every tree item selection :) |
@Narretz forgot to mention that at least 'textarea's are also affected in addition to input, maybe other elements too. I think this needs to be thoroughly investigated. |
what exactly do you mean by "blinking"? can you take a screencapture or something? I didn't see anything that looked like blinking reproducing on SL. |
Hi @caitp, |
well I still can't reproduce that at all on saucelabs (except, on one initial load of the page, before any refreshing, each input was invalid momentarily) --- but after that initial run haven't been able to get it to flicker at all. Anyways, it's really hard to identify the issue when I can't reproduce it consistently, maybe @Narretz would have a go at figuring out the cause. |
I've modified the plnkr, now you have a button, if clicked - it blinks :) |
@caitp you said that "on one initial load of the page, before any refreshing, each input was invalid momentarily" - that's what I'm getting too. But it doesn't have to be the initial load. I have a SPA, one area is divided into 2 parts: left has the content tree and the right area contains the editor specific to the selected tree item. When user clicks on the tree item I load the specific editor for it (SPA uses ui-router). With beta.11 experience was good, but with beta.15 every time user clicks on the tree item the newly loaded editor which contains many inputs/dropdowns/textareas - all those fields blink with red at first just like in the plnkr. As you may have guessed this makes a very strange/bad impression :) |
I believe that you're experiencing it, however I can't reproduce it consistently, it would be better for someone who can reproduce it consistently to investigate the issue. |
of course, thank you! |
I'll take a closer look at this :) |
I had a look at this and it seems fairly complex, although I might be missing something.
|
@caitp That actually means you could have a look at this, since it affects all browsers ;) |
If it affects all browsers, I would hope to be able to reproduce it in another browser---however I cannot get the affected behaviour at all outside of SL, and even there it occurred very rarely. I'm not sure this is even worth spending much effort on. It may be that the animation is unable to be cancelled correctly in IE for whatever reason, when it would be cancelled in Chrome or Firefox |
/cc @matsko |
I don't think it has anything to do with animations. I tested only in Firefox, but you should see ngModelWatch fires before the maxlength attribute is interpolated when inside ngRepeat, causing the initial validation to fail - you can only see a visual result in IE, though. This looks like an ngRepeat / compile bug, that's why I thought you might want to have a look. Have you had a look at my comment above the one where I @ed you? |
@snekbaev could you do me a favour and try out the patch I just wrote? I'm hoping this will be enough to reduce the janky behaviour you're seeing in IE, but I'm really not sure it will. It's very hard to test this effectively |
As soon as the jenkins build is ready I'll give you a link to the scripts built with that patch |
Previously, class toggling would always occur immediately. This causes problems in cases where class changes happen super frequently, and can result in flickering in some browsers which do not handle this jank well. Closes angular#8234
Previously, class toggling would always occur immediately. This causes problems in cases where class changes happen super frequently, and can result in flickering in some browsers which do not handle this jank well. Closes angular#8234
@snekbaev you should be able to try it with the files from https://ci.angularjs.org/job/angular.js-caitlin/561/artifact/build/ --- although that build in particular does have some gunk which has been subsequently removed, it should be good enough I think |
(from the PR)
|
In IE11 I was able to reproduce the red flashing in http://plnkr.co/mY219dSGAl1EEngRRavr it seems to be fixed by #9263 in IE11 as seen here http://plnkr.co/edit/d2qK45maTpcPTkU64ewI?p=preview |
@caitp thank you for taking care of this! I'm on vacation atm, however quick RDP to my work PC has revealed same results as @PaperElectron has previously encountered: first one blinks as expected, but second plnkr doesn't. Apparently you fixed it :) I will test it thoroughly when I'm back in a couple of weeks. Thanks again! |
When ngAnimate is used, it will defer changes to classes until postDigest. Previously, AngularJS (when ngAnimate is not loaded) would always immediately perform these DOM operations. Now, even when the ngAnimate module is not used, if $rootScope is in the midst of a digest, class manipulation is deferred. This helps reduce jank in browsers such as IE11. Closes angular#8234 Closes angular#9263
When ngAnimate is used, it will defer changes to classes until postDigest. Previously, AngularJS (when ngAnimate is not loaded) would always immediately perform these DOM operations. Now, even when the ngAnimate module is not used, if $rootScope is in the midst of a digest, class manipulation is deferred. This helps reduce jank in browsers such as IE11. Closes angular#8234 Closes angular#9263
When ngAnimate is used, it will defer changes to classes until postDigest. Previously, AngularJS (when ngAnimate is not loaded) would always immediately perform these DOM operations. Now, even when the ngAnimate module is not used, if $rootScope is in the midst of a digest, class manipulation is deferred. This helps reduce jank in browsers such as IE11. Closes angular#8234 Closes angular#9263
When ngAnimate is used, it will defer changes to classes until postDigest. Previously, AngularJS (when ngAnimate is not loaded) would always immediately perform these DOM operations. Now, even when the ngAnimate module is not used, if $rootScope is in the midst of a digest, class manipulation is deferred. This helps reduce jank in browsers such as IE11. Closes angular#8234 Closes angular#9263
When ngAnimate is used, it will defer changes to classes until postDigest. Previously, AngularJS (when ngAnimate is not loaded) would always immediately perform these DOM operations. Now, even when the ngAnimate module is not used, if $rootScope is in the midst of a digest, class manipulation is deferred. This helps reduce jank in browsers such as IE11. Closes angular#8234 Closes angular#9263
When ngAnimate is used, it will defer changes to classes until postDigest. Previously, AngularJS (when ngAnimate is not loaded) would always immediately perform these DOM operations. Now, even when the ngAnimate module is not used, if $rootScope is in the midst of a digest, class manipulation is deferred. This helps reduce jank in browsers such as IE11. Closes angular#8234 Closes angular#9263
Assigned to @caitp as she is working on a PR for this |
When ngAnimate is used, it will defer changes to classes until postDigest. Previously, AngularJS (when ngAnimate is not loaded) would always immediately perform these DOM operations. Now, even when the ngAnimate module is not used, if $rootScope is in the midst of a digest, class manipulation is deferred. This helps reduce jank in browsers such as IE11. Closes angular#8234 Closes angular#9263
When ngAnimate is used, it will defer changes to classes until postDigest. Previously, AngularJS (when ngAnimate is not loaded) would always immediately perform these DOM operations. Now, even when the ngAnimate module is not used, if $rootScope is in the midst of a digest, class manipulation is deferred. This helps reduce jank in browsers such as IE11. Closes angular#8234 Closes angular#9263
When ngAnimate is used, it will defer changes to classes until postDigest. Previously, AngularJS (when ngAnimate is not loaded) would always immediately perform these DOM operations. Now, even when the ngAnimate module is not used, if $rootScope is in the midst of a digest, class manipulation is deferred. This helps reduce jank in browsers such as IE11. Closes angular#8234 Closes angular#9263
When ngAnimate is used, it will defer changes to classes until postDigest. Previously, AngularJS (when ngAnimate is not loaded) would always immediately perform these DOM operations. Now, even when the ngAnimate module is not used, if $rootScope is in the midst of a digest, class manipulation is deferred. This helps reduce jank in browsers such as IE11. BREAKING CHANGE: The $animate class API will always defer changes until the end of the next digest. This allows ngAnimate to coalesce class changes which occur over a short period of time into 1 or 2 DOM writes, rather than many. This prevents jank in browsers such as IE, and is generally a good thing. If you're finding that your classes are not being immediately applied, be sure to invoke $digest(). Closes angular#8234 Closes angular#9263
Hi,
I was using beta 11 and everything was fine, upgraded to 15 and got the issue.
I output a complex object with several ng-repeats etc, which eventually boils down to something like:
I have CSS classes setup that highlight invalid fields with red. So after upgrade to beta 15 when entire object is rendered I see that input fields become red (my css style for invalid state) for a fraction of a second and then back to "valid" (non red). When I remove the maxlength attribute - no blinking occurs. As I mentioned beta 11 works just fine.
Thank you!
P.S.: using IE11
The text was updated successfully, but these errors were encountered: