Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onDrag override? #70

Open
davey-h opened this issue Jun 6, 2016 · 3 comments
Open

onDrag override? #70

davey-h opened this issue Jun 6, 2016 · 3 comments

Comments

@davey-h
Copy link

davey-h commented Jun 6, 2016

In the documentation it is mentioned that

All other props like onXX handler set to Tab will be passed to rendered element except onClick You can use any onXX for Supported events for tab element.

I wanted a way to override onDrag to make the tabs undraggable and noticed that I was getting no response to that event. Is it supported? Is there another way you'd suggest to disable dragging?

@georgeOsdDev
Copy link
Owner

Drag event is handled on wrapper component so there are no drag event on displaying li element.
https://github.com/georgeOsdDev/react-draggable-tab/blob/master/src/components/Tabs.js#L482
And this is main feature of this component.

If you want to disable dragging tab position change,
You can overwrite Tabs as your component like below.
https://gist.github.com/georgeOsdDev/f86a0e81c59a97f8579eb85365a2b4ca

@thisisbrianm
Copy link

thisisbrianm commented Nov 17, 2016

Follow up question - Is there any way to disable dragging for a single tab?
I notice the disableDrag property on <Tabs>, but it does not meet my use case.

I only want the first tab to be anchored, and all others draggable. Any ideas on how I can make that happen?

Thanks for any help.

@georgeOsdDev
Copy link
Owner

@thisisbrianm

For now, disableDrag is prop of Tabs,
We can enable change that as prop of Tab. I'm welcome your PR.

#81
https://github.com/georgeOsdDev/react-draggable-tab/blob/master/src/components/Tabs.js#L481

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

No branches or pull requests

3 participants