-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Wrong order in initialPreviewConfig #839
Comments
Yes you must not overwrite the For that scenario above you must return |
@kartik-v No offence, but I use your plugin for a long time and I know how to use it correctly. Of course I am returning
When sometimes initalPreviewConfig is in nonalphabetical order and we move for eg. |
@koxu1996 I see. The issue is not with initialPreview showing incorrectly. But it is more to do specifically with a very specific and special configuration for your use case:
So the issue is with no. 3 point above is. Since it uses the sortable plugin to drag sort... the plugin will only return the begin target and end target. and the files that are not uploaded yet will not be understood by the third party sortable plugin. Note that drag and drop using sortable is only enabled for It is thus recommended to NOT use The recommended options if you want to drag and sort the thumbnails in the preview are:
|
There is a bit of enhancement I think I can include to prevent sorting when |
What about fixing order in |
You don't understand me. I am talking about situation when all images are uploaded. |
Checking and will update... can you paste the code snippet that reflects the plugin configuration for your use case? |
You can see on video (0:24 and 0:44) that when I moved 2.png, I got alert Switched 3.png ... It is caused because wrong order in But when Currently |
Fixed and enhanced better. It also includes a better way to prevent sortable to be activated when the uploads are in process. A complex use case for you to try is to set an |
The sort after single file upload still exists. But for batch async uploads, yes as mentioned as per my comments earlier here and here... this is an intentional change. Now, if you click batch upload with Else you will have issues if you have 10 files being uploaded and say the 4th, 5th, and 8th files are not yet uploaded ... and if someone sorts it when these are in progress, the sorting order will change the initialPreviewConfig in an undesired manner (this is because the 4th, 5th, and 8th files cannot be dragged around - the order will surely be messed up). Hence the fix ensures, the sorting can be done only after all files are uploaded. |
@koxu1996 this problem has been solved? I am experiencing the same problem. |
@Minotti There were a few bugs, but the problem was solved few years ago - not sure if it still works. |
@koxu1996 I suspect it has been resolved in the past and is now not working again. |
Finally I figured out the problem with sorting. I setted
uploadAsync: true
. When you upload images for eg. 1.png, 2.png, 3.png, then upload is running in alphabetical order, butinitialPreviewConfig
not always will be["1.png", "2.png", "2.png"]
, because it depends on responses end time:In this case I got
["1.png", "3.png", "2.png"]
, but in preview I saw images in alphabetical order. So after switching first image (1.png in preview) with second (2.png in preview), theinitialPreviewConfig
is["3.png", "1.png", "2.png"]
, but should be["2.png", "3.png", "1.png"]
.Tomorrow I will provide video which simply show this issue.
The text was updated successfully, but these errors were encountered: