silverstripe-blog
silverstripe-blog copied to clipboard
Only lazy load categories dropdown if there is a large number of categories
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.
Is this good to be merged?
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
.
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.