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
Since rev 25.1 in some situations itemsPerRow gives 0 preventing the file to be shown.
That's because itemsPerRow is now the return value of the function getItemsPerRow = function(horizontalSpace, itemWidth).
If horizontalSpace < itemWidth the return is = 0 and the image is not shown without any warning.
Logs
To Reproduce
In my case the pond element is a fieldset with all elements inside having a margin of 2 pixels each side.
When loading files, I have 1 file for any row.
Until 25.1 itemsPerRow was always = 1.
With 25.2 itemsPerRow is always = 0.
Looking at HTML generated by filepond with a debugger, in my case:
horizontalSpace = 940
itemWidth = 944 (940 + 4 pixels for margins)
And in this situation the function
var getItemsPerRow = function(horizontalSpace, itemWidth) {
// add one pixel leeway, when using percentages for item width total items can be 1.99 per row
return Math.floor((horizontalSpace + 1) / itemWidth);
};
gives zero.
Once understood this, I solved my problem adding a CSS that shorted the file items, ex :
.filepond--item { width: 920px;}
Previously (Until 25.1 ) no filepond--item css was needed.
Expected behavior
If the computation of itemsPerRow is always done with at least one file to show, then getItemsPerRow() would return always a value >= 1.
Or if zero is the correct return value of getItemsPerRow(), perhaps would be better try to draw anyway the image.
In this way the rendering would show space problem and programmer would add/correct the related css.
Stacktraces
Information about your project:
Crome 86.01.1 64 bits
MacOS 10 .14.6
FilePond version: problem started with 52.2
Additional context
greetings
Andrea
The text was updated successfully, but these errors were encountered:
Describe the bug
Since rev 25.1 in some situations itemsPerRow gives 0 preventing the file to be shown.
That's because itemsPerRow is now the return value of the function getItemsPerRow = function(horizontalSpace, itemWidth).
If horizontalSpace < itemWidth the return is = 0 and the image is not shown without any warning.
Logs
To Reproduce
In my case the pond element is a fieldset with all elements inside having a margin of 2 pixels each side.
When loading files, I have 1 file for any row.
Until 25.1 itemsPerRow was always = 1.
With 25.2 itemsPerRow is always = 0.
Looking at HTML generated by filepond with a debugger, in my case:
horizontalSpace = 940
itemWidth = 944 (940 + 4 pixels for margins)
And in this situation the function
var getItemsPerRow = function(horizontalSpace, itemWidth) {
// add one pixel leeway, when using percentages for item width total items can be 1.99 per row
return Math.floor((horizontalSpace + 1) / itemWidth);
};
gives zero.
Once understood this, I solved my problem adding a CSS that shorted the file items, ex :
.filepond--item { width: 920px;}
Previously (Until 25.1 ) no filepond--item css was needed.
Expected behavior
If the computation of itemsPerRow is always done with at least one file to show, then getItemsPerRow() would return always a value >= 1.
Or if zero is the correct return value of getItemsPerRow(), perhaps would be better try to draw anyway the image.
In this way the rendering would show space problem and programmer would add/correct the related css.
Stacktraces
Information about your project:
Additional context
greetings
Andrea
The text was updated successfully, but these errors were encountered: