Bugzilla – Bug 5307
off-by-one bug in text entry widget (beta remote)
Last modified: 2007-08-26 00:19:53 UTC
Easiest way is to give an example: 1. Go to My Music|Search|Artists The display shows: 8 9 > {space} a 2. Scroll down The selector jumps to "a" (not {space}) I first noticed this in the Wireless password entry screen but it is also present in all searches, and I presume anywhere the widget is used.
should be fixed at r343 (we'll need a new way to have the autolinks for change numbers if we want them) please give it a try and reopen if there are any problems with what I've done. For the record, here is the patch applied: Index: Textinput.lua =================================================================== --- Textinput.lua (revision 342) +++ Textinput.lua (working copy) @@ -104,8 +104,12 @@ -- find current character local i = string.find(v, s2, 1, true) - -- move dir characters - i = i + dir + -- move dir characters, compensating for the initial nil value + if (not (dir > 0 and s2 == "")) then + i = i + dir + end + + -- handle wrap around conditions if i < 1 then i = i + #v elseif i > #v then