How to disable scroll when list is just three

how to disable scroll when the list is just three ? thanks