openvanilla / McBopomofo

小麥注音輸入法
http://mcbopomofo.openvanilla.org/
MIT License
624 stars 76 forks source link

Fixes the issue where it skips the candidates before the new index on the next page when switching pages #453

Closed skyeyvapor closed 7 months ago

skyeyvapor commented 7 months ago

Problem:

Solution:

  1. For forward page switching: Retrieve the index of the last visible row and scroll to the subsequent last visible row.
  2. For backward page switching: Retrieve the index of the first visible row and scroll to the previous first visible row.
  3. Otherwise, scroll to the new value.
  4. 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.