You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I've set the threshold option for the ItemMovement plugin, but it doesn't seem to respect the threshold in cases. The items move immediately when clicked if the dates are slightly off of the "cadence" of the calendar as well. For instance, if I have an item with a date of Jun. 25 - Jul 25 and I'm looking in a monthly zoom, when I click the item, the item will sometimes immediately "snap" to either Jun 1-Jul 1 or to Jul 1-Aug 1.
Code
How to reproduce this error?
Paste your code here with example data.
{threshold: {horizontal: 500,vertical: 500},autoScroll: {speed: {vertical: 0}},events: {onMove(ev: OnArg){// items before the current movementreturnev.items.before.map((beforeMovementItem,index)=>{// item data after moveconstafterMovementItem=ev.items.after[index];// clone item to prevent bugsconstmyItem: Row=GSTC.api.merge({},afterMovementItem);// Prevent items moving between rowsmyItem.rowId=beforeMovementItem.rowId;// return modified item (or not if we don't want to move it -> return beforeMovementItem;)returnmyItem;});},onEnd(ev: OnArg){// that.saveDateModifications(ev.items);// Submit changes to any items affected by the resize.ev.items.after.forEach((item,i)=>{if(item.time&&(item.time.start!==ev.items.initial[i].time.start||item.time.end!==ev.items.initial[i].time.end)){that.itemMoved.emit({
item,start: newDate(item.time.start).toISOString(),end: newDate(item.time.end).toISOString()})}});returnev.items.after;}},}
gantt-schedule-timeline-calendar version
What version are you using? 3.19.0
You can get it from package.json or with state.get('config.version').
Screenshots or movies
If applicable, add screenshots or movie to help explain your problem.
Screen.Recording.2023-01-10.at.3.07.54.PM.mov
The text was updated successfully, but these errors were encountered:
Been a couple months, the clamping issue is a pretty critical issue for my users to use the interactive features of the plugin. Any suggestions on how to prevent the items from immediately snapping to new dates and causing a move event that could unknowningly shift dates for items?
It seems like threshold should theoretically make it so that things don't automatically snap to the grid, let me know if I need to implement this in a different way.
Perhaps there is an alternate flow where the user need to fully click to select an item, and THEN they can click and drag that item. This two click method, while not ideal for some use cases, could help when the movement of an item is really sensitive and would help establish more intention to a movement action.
Any advice or update you could provide would be super helpful. Thanks!
Describe the bug
I've set the
threshold
option for theItemMovement
plugin, but it doesn't seem to respect the threshold in cases. The items move immediately when clicked if the dates are slightly off of the "cadence" of the calendar as well. For instance, if I have an item with a date of Jun. 25 - Jul 25 and I'm looking in a monthly zoom, when I click the item, the item will sometimes immediately "snap" to either Jun 1-Jul 1 or to Jul 1-Aug 1.Code
How to reproduce this error?
Paste your code here with example data.
gantt-schedule-timeline-calendar version
What version are you using? 3.19.0
You can get it from
package.json
or withstate.get('config.version')
.Screenshots or movies
If applicable, add screenshots or movie to help explain your problem.
Screen.Recording.2023-01-10.at.3.07.54.PM.mov
The text was updated successfully, but these errors were encountered: