vue-js-grid icon indicating copy to clipboard operation
vue-js-grid copied to clipboard

Horizontal position error

Open euvl opened this issue 8 years ago • 2 comments

Horizontal position does not work correctly when body's padding is not 0

euvl avatar Sep 27 '17 12:09 euvl

This happens because euvl look for window size (tale a look at mixins)

bitcoinmaniac avatar Oct 20 '18 06:10 bitcoinmaniac

@bitcoinmaniac An update to the documentation with be greatly appreciated rather than a fragile "take a look at x" message ;)

Incase anyone stumbles upon this and can't for their life figure out how to resize the entire container because it is for some odd reason assuming that you always use the window size rather than the container's size?

Just add this thingy thing to your Wrapper Vue Component

    mounted() {
        window.innerWidth = this.$el.getWidth();
        window.dispatchEvent(new Event('resize'));
    }

Now your grid is perfectly aligned to your vue component's wrapper, as it should be

Only downside is that we have now changed the window's innerWidth so god, knows what other issues will come from this

I got no idea why or how mixins work, but i digged into the window_size.js mixin and noticed the window.innerHeight and window.innerWidth was used, these are global variables and can be fiddled with, lucky.

WebKenth avatar Feb 18 '21 10:02 WebKenth