Skip to content
This repository has been archived by the owner on Dec 25, 2022. It is now read-only.

Distance between boxes is not always homogeneous #13

Open
valerioleo opened this issue Feb 10, 2020 · 4 comments
Open

Distance between boxes is not always homogeneous #13

valerioleo opened this issue Feb 10, 2020 · 4 comments

Comments

@valerioleo
Copy link

Hey @AndreasFaust, thanks for the great library, it does exactly what we were looking for.

At the same time, I have noticed that the boxes don't always have the same distance one to another as you can see from the following image. It is very subtle, but the first gutter is slightly bigger than the second:
image

To reproduce, I have created a little sandbox that might help you find the issue: https://codesandbox.io/s/eloquent-driscoll-o47el

Hopefully, it helps.
Thanks again for the great work.

@luliandro
Copy link

hi, I'm having the same issue.

did you manage to get it fixed?

@tayteboss
Copy link

Hey, I have the same issue as well...

Any fixes on this?

@matthewfamularo
Copy link

Same issue.

@dowrow
Copy link

dowrow commented Jan 2, 2021

@luliandro @tayteboss @matthewfamularo @valerioleo
I believe this is caused by the component measuring the width of the content before the fonts are loaded at first render, or at least that was causing me this same issue.

My quick fix was to wrap a visibility observer around the Ticker like this:


import Ticker from 'react-ticker';
import { useInView } from 'react-intersection-observer';

export default function Marquee({ children }) {
    const { ref, inView } = useInView({
        threshold: 0,
    });

    return <>
        <div ref={ref} className="container">
            {
                inView && <Ticker>
                    {
                        () => (children)
                    }
                </Ticker>
            }
        </div>
    </>;
}

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

No branches or pull requests

5 participants