In VerticalCandidateController, consider the scenario where you're searching for the 10th candidate "試", located at the top of the second page. Upon highlighting the 4th candidate "式" and moving to the next page, "室" appears at the top. This sequence completely skips over "試", "勢" and "適".
Solution:
For forward page switching: Retrieve the index of the last visible row and scroll to the subsequent last visible row.
For backward page switching: Retrieve the index of the first visible row and scroll to the previous first visible row.
Otherwise, scroll to the new value.
Handling scenarios involving scrolling: Even the selected candidate is not visible after scrolling, the page can be switched forth or back. The underlying selected candidate index can be updated accordingly. Pressing the up or down button will then bring the selected candidate back visible at the top of the page.
Problem:
Solution: