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

[BUG] Ticker speeds up only on Safari after hovering multiple times on parent conatiner #59

Open
kstoklosa opened this issue Apr 13, 2022 · 0 comments

Comments

@kstoklosa
Copy link

kstoklosa commented Apr 13, 2022

I have the Ticker component wrapped with some div (Container), and I'm detecting onHover actions with mouseover and mouseout event listeners. If someone hovers over the Ticker, I want it to stop moving.

Everything works perfectly fine on various browsers, but on Safari I'm getting this weird bug - after repetitive hovering/not hovering element, Ticker component increases its speed (and sometimes it's displaying white space before the next element).

Code sample:

    <Container ref={tickerRef}>
      <Ticker move={!isHovered} speed={5}>
        {() => (
          <div>
            {items.map((item) => {
              return <div key={item.id}>{item.name}</div>;
            })}
          </div>
        )}
      </Ticker>
    </Container>

I managed to solve that issue with removing move prop and then defining speed value based on hovered state (speed={isHovered ? 0 : 5}) but it's far from perfect. I wonder if there are some other ways to fix that issue?

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

1 participant