fix the scroll problem and show nearest item