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
See initialPreviewConfig by entering this in web console: JSON.stringify($('#input-pd').data('fileinput').initialPreviewConfig)
Now you can see there is one element in initialPreviewConfig left, for example: "[null,null,{"type":"video","size":375000,"filetype":"video/mp4","caption":"KrajeeSample.mp4","url":"/file-upload-batch/2","key":3},null,null,null]", although fileinput is empty!
While trying to fix #779 I ran into this issue.
Reproduce:
JSON.stringify($('#input-pd').data('fileinput').initialPreviewConfig)
"[null,null,{"type":"video","size":375000,"filetype":"video/mp4","caption":"KrajeeSample.mp4","url":"/file-upload-batch/2","key":3},null,null,null]"
, although fileinput is empty!What cause this:
https://github.com/kartik-v/bootstrap-fileinput/blob/master/js/fileinput.js#L231-L233
Like in this question http://stackoverflow.com/questions/40317226/two-references-to-object-but-when-modify-it-by-one-second-still-show-unchanged, here we have
initialPreviewConfig
referenced bypreviewCache.data[id].config
, so writingpreviewCache.data[id].config = []
would not changeinitialPreviewConfig
.The text was updated successfully, but these errors were encountered: