react-xarrows icon indicating copy to clipboard operation
react-xarrows copied to clipboard

animateDrawing shows dashed line on first render

Open SimmonsRitchie opened this issue 3 years ago • 7 comments

Hey there! Cool package. Unfortunately I think I may have found a bug with the animateDrawing prop. I'm using v2.0.2

When animateDrawing is set to true, I'm seeing a dashed line appear on first render instead of seeing the arrow animate cleanly. Strangely, the arrow does animate properly if the component is removed and then added again to the DOM.

This dashed effect happens even if the dashness prop is set to false.

To Reproduce Here's a code sandbox with a reproducible example. Refresh the preview and you should see a dashed line instead of the animation.

import "./styles.css";
import Xarrow, { Xwrapper } from "react-xarrows";

export default function App() {
  return (
      <div className="container">
        <Xwrapper>
          <div
            style={{
              width: "50px",
              height: "50px",
              backgroundColor: "blue",
              alignSelf: "start"
            }}
            id={"start"}
          />
          <div
            style={{ width: "50px", height: "50px", backgroundColor: "red" }}
            id={"end"}
          />
          <Xarrow
            start={"start"}
            end="end"
            animateDrawing={true}
            dashness={false}
          />
        </Xwrapper>
      </div>
  );
}

Screenshots Here's how the arrow appears on initial render: example-react-xarrows-bug

SimmonsRitchie avatar Oct 11 '21 01:10 SimmonsRitchie

Great report, Thanks!

Eliav2 avatar Oct 11 '21 16:10 Eliav2

@SimmonsRitchie were you able to find a workaround?

la55u avatar Dec 06 '21 10:12 la55u

Is there any workaround? Kindly respond! @SimmonsRitchie @Eliav2

anserwaseem avatar Nov 29 '22 10:11 anserwaseem

Is there any workaround? Kindly respond!

@SimmonsRitchie @Eliav2

Sorry, I think I abandoned this package after I encountered this bug. It seemed like a cool package but that issue was a bit of a dealbreaker for me in my use case.

SimmonsRitchie avatar Nov 29 '22 13:11 SimmonsRitchie

Is there any workaround? Kindly respond! @SimmonsRitchie @Eliav2

Sorry, I think I abandoned this package after I encountered this bug. It seemed like a cool package but that issue was a bit of a dealbreaker for me in my use case.

Which package did you use then?

anserwaseem avatar Nov 30 '22 11:11 anserwaseem

Same issue, any joy finding a solution or alternative?

FrogSmack avatar Jun 14 '23 08:06 FrogSmack

Same here, any workarounds or other libraries ?

cordial avatar Feb 09 '24 19:02 cordial