Fixes #1245, scrolling large/small modal not working correctly