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

DnD: draggableAccessor is ignored #1068

Closed
xtursky opened this issue Oct 29, 2018 · 4 comments
Closed

DnD: draggableAccessor is ignored #1068

xtursky opened this issue Oct 29, 2018 · 4 comments

Comments

@xtursky
Copy link
Contributor

xtursky commented Oct 29, 2018

Do you want to request a feature or report a bug?

bug

What's the current behavior?

draggableAccesor which is used to resolve if event is draggable or not is ignored. Referencing wasn't fixed after recent wrapping into draggable object.

const { draggableAccessor, resizableAccessor, draggable } = this.context

https://github.com/intljusticemission/react-big-calendar/blob/master/src/addons/dragAndDrop/EventWrapper.js#L80

What's the expected behavior?

I know PR, but I don't have much time now.

const { draggable } = this.context;
const { draggableAccessor, resizableAccessor } = draggable;
@arecvlohe
Copy link
Collaborator

Fixed in #1070

@artooras
Copy link

artooras commented Dec 5, 2018

Would you be able to provide an example on how to disable draggability on some events when this feature is enabled on the entire calendar? I cannot understand how to do that looking at documentation and src. Thanks!

@xtursky
Copy link
Contributor Author

xtursky commented Dec 10, 2018

@artooras sorry for not answering sooner. Yes there is not much info in documentation, I had to check code for dnd, but it's not so complicated.

Basically you need to implement either draggableAccessor or resizableAccessor or both which returns boolean in this case. So for example I have events with different types based on which I can disable this functionality.

eventIsEditable = (event: YourEventData) => { const isEditable = someCondition(event); return isEditable; };

@artooras
Copy link

Thank you!

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

No branches or pull requests

3 participants