openvanilla / McBopomofo

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

Reset the key label index after scrolling #454

Closed lukhnos closed 5 months ago

lukhnos commented 5 months ago

If the vertical candidate table view gets scrolled, the key strip label highlight also needs to be readjusted, otherwise the highlighted key label won't match that of the new highlighted row in the table view.

Notice that we only readjust keyLabelStripView.highlightedIndex after the scroll is done. We hide the highlight during the scroll, so as to reduce the visible mismatch between the two highlights.

lukhnos commented 5 months ago

This fixes an issue that I discovered while reviewing https://github.com/openvanilla/McBopomofo/pull/453; we very much overlooked this when we introduced the delayed scrollRowToVisible logic a few months ago.