Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

size mismatch #202

Open
defields923 opened this issue Apr 25, 2018 · 17 comments
Open

size mismatch #202

defields923 opened this issue Apr 25, 2018 · 17 comments

Comments

@defields923
Copy link

I am having an issue since I upgraded from version 1.x to the latest. I have a list of elements all the same size within a ul that has a height of calc(100% - 31px). vs-repeat appears to be working, but I get that size mismatch error in the console, and many more are logged when I scroll. I tried adjusting the size option like so 'vs-repeat="{size: ...}"' to try and match the expected size, but I can only get as close as .000000001... to it no matter how much I try.

Was this an issue in the earlier version that just wasn't logged? What should I do to correct this, or is there at least a way of turning the logging off?

@XueDong369
Copy link

I have the same problem with you!
vsRepeat: size mismatch. Expected size 0px whereas actual size is 287px. Fix vsSize on element: <ul class=​"common-list-content" vs-repeat=​"{size:​ 36}​">​…​</ul>​

@tje3d
Copy link

tje3d commented Apr 26, 2018

You cant get rid of size mismatch, because if you set fixed size for your vs-repeat, you always have this warning, and if you don't set it, You don't have any scroll ( because the size of vs-repeat should not be same as sum of all elements height )

Any suggestion?

Edit

Whoops! i've upgraded to 2.0.9 and there is no problem any more, My markup:

<div class="overview vs-repeat-custom-scroll" vs-repeat> <!-- style="height: calc(100%); overflow: auto;" -->
    <div ng-repeat="group in groups | groupsList:groupsFilter:searchGroup" ng-class="{conv_selected: group.active}" ng-click="selectGroup(group)">
        <!-- ... -->
    </div>
 </div>

@matortheeternal
Copy link

matortheeternal commented Apr 28, 2018

I've experienced this issue on v1.1.11 as well as v2.0.9. I tried setting autoresize to true in the vs-repeat attribute options, but this did not fix the issue. Hardcoding a size does not make sense for my application where the window is resizable. My temporary solution is to downgrade back to v1.1.7. The size should just be computed based on the element's size by default like it was in v1.1.7, without requiring any dirty CSS workarounds like height: calc(100%).

@XueDong369
Copy link

I am using v2.0.9 now, but this problem always not fixed yet!

@tje3d
Copy link

tje3d commented May 1, 2018

My problems is when i apply a filter to my ng-repeat, and the height of my items goes lower than vs-repeat height, i always have size mismatch warning.
a hackfix is to calculate vs-repeat size when a filter applies but this is not the correct way.

@icorne
Copy link

icorne commented May 2, 2018

I also get this issue, and when using the latch option, it's complaining about the wrong size as well, als the size should be a lot smaller

@XueDong369
Copy link

@tje3d But it will cause the performance problem if the warning log always repeat ...

@tje3d
Copy link

tje3d commented May 10, 2018

@XueDong369 please check my pull request #206
it will prevent warning when there is no overflow scroll

@XueDong369
Copy link

@tje3d Yes, I've changed the local code to #206 temporarily, then it won't console the warning info. Thanks! But, my project will run in Docker and it will run 'bower install' in Docker every time when I deploy it. I hope #206 will be merged ASAP. _

@tcrite
Copy link

tcrite commented Jul 3, 2018

I had this same issue. Fixed it by inspecting every element in row and taking into account margins. Also had an inner element whose margin expanded pass the parent container causing the calculated size to be off.

@tcrite
Copy link

tcrite commented Jul 3, 2018

also, hiding the warning is just a mask...the underlying issue of the size being off will still end up in performance issues.

@juanjmunozgonzalez
Copy link

Hi, I get the same warning message and, what it is more relevant for IE11 (I'm forced to support it) the items are not rendered if I drag the scroll to the bottom. This only happens if I don't configure the item size, if I fix the item size, everything works but the performance gets worse, I experiment some glitches when I drag the scroll

@DanielRuf
Copy link

Any news?

@ibrychgo
Copy link

Same here. Getting this on list of md-cards (angularjs material). Was hoping for an easier solution to md-virtual-repeat.

@erceth
Copy link

erceth commented Oct 7, 2021

I was able to work around the warning spam by removing the margin from my list elements. I think it was due to the fact that child margin doesn't affect parent height (https://stackoverflow.com/q/27829250/3038518). Perhaps a future fix for this bug would involve that information somehow.

@lslee714
Copy link

Love 3 year old issues

@kerryj89
Copy link

kerryj89 commented Jun 1, 2022

My previous comment (since deleted) was a false positive, but I am able to hide the warnings with the below snippet. I'm not well versed in AngularJS but piecing together some knowledge I was able to override (set?) sizeMismatchWarningsSilenced to true via decorator. I tried the more common way to config with angular.module('whatever', ['vs-repeat']).config(['vsRepeatConfig', function(vsRepeatConfig) {...}) but couldn't get it to work. Maybe someone more knowledgeable in AngularJS can see the error in my way.

angular.module('whatever', ['vs-repeat'])
    .config(['$provide', function($provide) {
        $provide.decorator('vsRepeatConfig', function($delegate) {
            return {
                ...$delegate,
                sizeMismatchWarningsSilenced: true
            };
        });
    }])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests