-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Revamp Drag and drop #917
Revamp Drag and drop #917
Conversation
closes #891 |
f909681
to
af2d183
Compare
you are a rockstar @jquense! |
😲 Awesome! |
@jquense when will that be released? |
How can we npm update the change? |
@sendajob You can change your package.json to directly point to the repository on Github, to get the latest updates on it: https://docs.npmjs.com/files/package.json#github-urls ...
dependencies: {
...
"react-big-calendar": "intljusticemission/react-big-calendar",
...
} |
When i do that the src folder is missing. any idea how to fix? |
@sendajob can you provide some additional information, like if you are using yarn or npm, your OS, the exact error msg, a screenshot and/or your package.json? You can try the following: $ cd node_modules/react-big-calendar/
$ yarn
$ yarn build |
When i set dependency the react-big-calendar/ in node_modules only has no src no dist |
I tried to fetch dependency from github in the way @miltonmc proposed. It was successfully imported, but I got |
we still need #921 which has a few bug fixes to this initial PR |
@jquense I've been testing this and it works really well! Huge improvement. The only complaint I have is that the events lose their height while you're dragging them. |
hmm that doesn't sound right, in what context? |
@jquense I am using the "day" Calendar. import BigCalendar from "react-big-calendar";
import withDragAndDrop from "react-big-calendar/lib/addons/dragAndDrop";
const Calendar = withDragAndDrop(BigCalendar, { backend: false });
// Probably not that useful - let me know if there's something
// that would be helpful to include
<Calendar
localizer={localizer}
defaultView="day"
defaultDate={moment(date).toDate()}
views={["day"]}
toolbar={false}
step={dayIncrement}
timeslots={timeslots}
events={items}
selectable={false}
onEventResize={this.resize}
onEventDrop={this.drop}
resizable={true}
allDayAccessor={this.getTaskWithoutTime}
startAccessor={this.getTaskStartTime}
endAccessor={this.getTaskEndTime}
tooltipAccessor={this.getTooltip}
components={{
event: DayTask,
}}
/> BTW, I get the same behavior when I don't use the custom |
OK, the problem is that I'm using let end = dates.add(
currentSlot,
dates.diff(event.start, event.end, 'minutes'),
'minutes'
) |
hello. |
@nnals The way I did this was: I forked the repo, ran |
Hi, I seem to have lost the ability to drag calendar items outside of the calendar. Is this by design? |
ugh so i know i said i wasn't going to work on this, but I had some time this weekend and felt inspired at a simpler approach than what we've been doing.
A lot of the code changes here are unrelated core hygiene improvements, but they do help make the DnD implementation simpler.
Ultimately i realized that we already had most of the hard work done for doing a custom DnD implementation thanks to the event Selection logic. Rather than use a new library i've leveraged that to do direct calculations on where things should be in relation to the mouse