georgeOsdDev / react-draggable-tab

Atom like draggable tab react component

Home Page:http://georgeosddev.github.io/react-draggable-tab/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

handleTabClick being called after drag stop only when a tab has been dropped before another tab

uriklar opened this issue · comments

Let's say I have Tab1/Tab2/Tab3
If I drag Tab1 in front of Tab2, handleTabClick isn't called.
If I drag Tab3 before Tab2 (so the order is Tab1/Tab3/Tab2) the handleTabClick function is triggered.
Is this expected behavior?
Thanks!
Uri

Hi Uri,

I think keepSelectedTab prop resolve your confusion.

When keepSelectedTab=true,
case moved tab is selectedTab:
=> onTabSelected will be triggered.
case moved tab is not selectedTab:
=> onTabSelected will not be triggered.

Please try demo with opening console.
http://georgeosddev.github.io/react-draggable-tab/example/

Is there a way to prevent onTabSelected from being triggered in all drag drop cases?
I tried changing the values of keepSelectedTab but onTabSelect still gets triggered on the case I described.