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

Changing window size or zoom level collapses gutters #18

Open
dtgay opened this issue Oct 31, 2022 · 0 comments
Open

Changing window size or zoom level collapses gutters #18

dtgay opened this issue Oct 31, 2022 · 0 comments

Comments

@dtgay
Copy link

dtgay commented Oct 31, 2022

Hey there, thanks for such a clean, simple library!

Platform

macOS 12.6, Brave Version 1.45.113 Chromium: 107.0.5304.62 (Official Build) (arm64)

Setup

  • Parent div, set to relative, which I apply minimasonry to
  • Child divs, set to absolute (have the following Tailwind classes applied: absolute flex flex-col justify-between p-4 shadow-md border-l-4 bg-gray-100 border-gray-500 rounded-sm tracking-widest leading-loose mb-4
new MiniMasonry({
      baseWidth: 512, // Target width of elements.
      container: this.element, // Container selector or HTMLElement. Required.
      gutter: 16, // Width / height of gutter between elements. Use gutterX / gutterY to set different values.
      surroundingGutter: false, // Set left gutter on first columns and right gutter on last.
});

Description

I'm experiencing an issue where gutters between items are reduced in size as the result of resizing the window/viewport. All of the following screenshots were taken on the same page load (no refresh):

Default page load:

Xnip2022-10-31_07-46-43

After reducing window size:

Xnip2022-10-31_07-46-57

After increasing window size (after being reduced):

Xnip2022-10-31_07-47-23

Images of other viewport sizes:

Xnip2022-10-31_07-47-42

Xnip2022-10-31_07-47-31

This happens on zoom level change too, not just window resize. This is after reducing and increasing and reducing zoom level a bunch:

image

Manually calling a redraw after window resize doesn't seem to have any effect. Looking at the library, it seems like a redraw automatically happens on resize, anyway.

Is there anything I can do to alleviate this, even if it's a bit hacky?

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

1 participant