Skip to content
This repository has been archived by the owner on Jan 16, 2023. It is now read-only.

Fast clicks lead to visual bugs #84

Open
Hypnosphi opened this issue Jul 28, 2017 · 3 comments
Open

Fast clicks lead to visual bugs #84

Hypnosphi opened this issue Jul 28, 2017 · 3 comments

Comments

@Hypnosphi
Copy link

screen shot 2017-07-28 at 21 47 00

Reproduced in Chrome, FF, and Safari

@tatsujb
Copy link

tatsujb commented Aug 17, 2017

+1

@thomasjm
Copy link

thomasjm commented Dec 8, 2017

I'm seeing something I think is related, but let me know if I should open a separate issue...

I think that any fast changes to the data prop can cause the treeview to end up rendered wrong. I think this is due to a race condition with animations, because when I turned animations off the issue stopped happening.

In my case, I update data several times in <1 second, and at the end of the process a node that has toggled: true is closed when it should be open.

It would be great to make the animations robust to fast changes. It looks like the underlying issue might be google-fabric/velocity-react#212

@mishaberman
Copy link

What I did to alleviate this issue is to set the animations to happen at a 100ms duration:

--animations.js--

export default {
toggle: ({ node: { toggled } }) => ({
animation: { rotateZ: toggled ? 90 : 0 },
duration: 100
}),
drawer: (/* props */) => ({
enter: {
animation: "slideDown",
duration: 100
},
leave: {
animation: "slideUp",
duration: 100
}
})
};

          <Treebeard
            data={this.state.data}
            onToggle={this.onToggle}
            animations={animations}
            style={styles}
          />

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

No branches or pull requests

4 participants