silverstripe-blog icon indicating copy to clipboard operation
silverstripe-blog copied to clipboard

Only lazy load categories dropdown if there is a large number of categories

Open purplespider opened this issue 3 years ago • 3 comments

By lazy loading the dropdown, authors cannot see the list of existing categories to pick from and have to think of one from memory and start typing it.

This only sets the dropdown values to lazy load if there are more than 15 existing categories. 15 was chosen as this is also the number of categories that appear on one page of the Categories grid field.

purplespider avatar Mar 05 '21 19:03 purplespider

Is this good to be merged?

purplespider avatar May 27 '22 12:05 purplespider

Also, why 15?

Personally, I would have just set lazy loading to always be false for categories. I'd imagine that only in edge cases would there be so many as to cause an issue and it could be easily overridden in an extension then.

However, I assumed it was done for a reason, and as mentioned I just picked 15 as this is also the number of categories that appear on one page of the Categories grid field, which, I've just checked, is actually the $default_items_per_page for GridFieldPaginator.

purplespider avatar May 27 '22 15:05 purplespider

Thinking about it, it's not just about technical load, but also UX. Showing a dropdown list of 100 items to a user isn't very useful, it's unlikely they'll manually look through the whole list, and would just type to filter anyway.

purplespider avatar May 27 '22 15:05 purplespider