Is your feature request related to a problem? Please describe.
It could be nice if we show customized information while dragging (moving or resizing) items (currently only showing time and groupLabelKey).
Describe the solution you'd like
Provide a renderer for InfoLabel the same way like groupRenderer or itemRenderer.
Describe alternatives you've considered
At least give an option to hide InfoLabel while dragging. (Sometimes you do not like it to show)
Additional context
I checked your feedback of the request to customize the header (#48)
But I think this one is much easier and really does not take so much resource, so I will be very graceful this time if you do not close this one that recklessly.
Finally I added the simple function by myself (a personal account).
I will be grateful if you have time to review and pull it. (This will be the first time I contribute to oss, excited! )
@mariusandra @Ilaiwi
@FutureArchitect-wang2449 Thank you for your first PR. I really appreciate your help. I have another suggestion that will be more helpful. Let's add a new prop called onDragUpdate and remove the infoLabel component. If a user wants to add an InfoLabel they can do it via this callback Prop.
It is also a good idea to include a sandbox example on that. it would be also great if you would provide an example of an added on infoLabel with his new prop.
The code would look something like this: https://github.com/FoothillSolutions/react-calendar-timeline/commit/a43f8e5cb89a3a0552e426d3590777df86ed9b4e
Good luck :)
@Ilaiwi
Let's add a new prop called onDragUpdate and remove the infoLabel component.
Thank you for your suggestion. I totally aggree your points of view.
However, I noticed there is already one prop which is triggered when items are being dragged. That prop is moveResizeValidator(action, itemId, time, resizeEdge), although it is not for render something, instead, for validation (as its name describes).
Further more, there is also a groupLabelKey in the keys prop which is all the way for this InfoLabel, so I suppose the developers of this component laid strong emphasis to the InforLabel
Considering the present situation, I added the renderer for the InfoLabel instead of a total free handler.
I appreciate if you take the current work (that they have done for InfoLabel) in consideration.
@FutureArchitect-wang2449 so this new function would be called after calling the moveResizeValidator. So you will get the final update that will be reflected in the UI.
I don't think the groupLabelKey is a problem. You can just delete it. I would rather give the user more control than being restricted to a feature. Plus less code to maintain :D
I can't see your implementation link. Do you mean the PR?
@FutureArchitect-wang2449 thanks for creating this issue! I'm also looking for the same functionality. How is your PR going? Is there anything I can help with?
@tobiasbueschel Thank you if you can help, currently I don't have anything updated ever since the PR.
I totally agree with @Ilaiwi 's idea to make a general renderer while dragging instead of only infoLabelRenderer. What do you think? You can give your PR to resolve this issue.
@tobiasbueschel, I am looking for this customizability myself. I'd be happy to start on a PR for it if you aren't already in-progress.
Hey @trevdor & @tobiasbueschel 馃憢! Not sure if either of you are actively working on this but I started working on a PR to address this based off @Ilaiwi's feedback. I'm aiming to have something up for review early next week.
Awesome, @bettymakes!
I poked around with it a bit last weekend (diff here) in case you wanna compare approaches. I honestly have already forgotten what state I left it in, so don't hold any of it against me. :)
:EDIT: Just glanced at it for a sec--important to note I never ran my code once. Was just in the middle of winging it. No idea if "my approach" works at all.
@bettymakes I would be happy to review and merge your PR.
@bettymakes If there's anything I can do to help, I'm hoping to demo a timeline without the default info label end of this month, so I'm happy to collaborate or write tests or whatever might be of use.
Hey @trevdor 馃憢! I've got a PR up, I took a slightly different approach than what was first suggested. I'm interested in seeing what @Ilaiwi thinks.
released in 0.26.0
Most helpful comment
Awesome, @bettymakes!
I poked around with it a bit last weekend (diff here) in case you wanna compare approaches. I honestly have already forgotten what state I left it in, so don't hold any of it against me. :)
:EDIT: Just glanced at it for a sec--important to note I never ran my code once. Was just in the middle of winging it. No idea if "my approach" works at all.