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

Initializing two different instances causes one to fail. #102

Open
jankeistoer opened this issue Nov 17, 2023 · 1 comment
Open

Initializing two different instances causes one to fail. #102

jankeistoer opened this issue Nov 17, 2023 · 1 comment
Labels

Comments

@jankeistoer
Copy link

jankeistoer commented Nov 17, 2023

Expected Behavior

I expect both instances to work properly and set correct sizes.

Actual Behavior

One of the instances works perfectly but the height of the second instance is incorrect.

Step-by-step reproduction instructions

  1. Place two different containers on a webpage.
  2. Initialize both
  3. Check the height of each container

I use the following configuration:

const macyInstance = Macy({
            container: `#${wrappedId}`,
            columns: 1,
            margin: {
                x: 32,
                y: 32,
            },
            mobileFirst: true,
            breakAt: {
                576: {
                    columns: 2,
                },
                992: {
                    columns: 3,
        },
    },
});

macyInstance.recalculate();

Screenshots, screen recordings, code snippets

If possible, please upload a screenshot or screen recording which demonstrates the bug.

This is the first instance:

image

This is the second instance:

image

@jankeistoer
Copy link
Author

Problem was solved with the recalculateOnImageLoad function.

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

No branches or pull requests

1 participant