Bug 180358 - [Apply Patch] Cursor jumps to beginning of filename field on keystroke
Summary: [Apply Patch] Cursor jumps to beginning of filename field on keystroke
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Compare (show other bugs)
Version: 3.3   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.3 M7   Edit
Assignee: Platform-Compare-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2007-03-31 14:15 EDT by Matt McCutchen CLA
Modified: 2007-04-26 09:57 EDT (History)
0 users

See Also:


Attachments
Fix by not calling setSourceName when text field is selected (801 bytes, patch)
2007-03-31 14:44 EDT, Matt McCutchen CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matt McCutchen CLA 2007-03-31 14:15:02 EDT
Build ID: HEAD as of 3/31/2007

In the Apply Patch wizard, each time I type a character in the filename field, the cursor jumps to the beginning of the field.  Thus, if I want to type in a path, I have to press the "End" key after each character so that the next one is added at the end of the field.  This makes the field almost unusable for manual entry of a path.

I found the cursor only jumps the first time the given path is typed on the current run of the Apply Patch wizard.  The cursor doesn't jump after a path is selected with Browse, and selecting a path with Browse does not stop the cursor from jumping if the same path is later typed in manually.  It doesn't matter whether the file named by the path exists.

Steps To Reproduce:
1. Right-click a resource -> Team -> Apply Patch.
2. Press the File radio button.
3. Click in the filename text field and type something.
Comment 1 Matt McCutchen CLA 2007-03-31 14:44:38 EDT
Created attachment 62591 [details]
Fix by not calling setSourceName when text field is selected

I debugged and found the following: Typing into the text field causes a widget selected event.  That event activates the listener at line 377 of InputPatchPage, which calls setSourceName to ensure that the new path is in the drop-down history list.  If the path is not already present, it is added.  (This is why the cursor only jumps the first time a given path is typed.)  Adding the path involves temporarily clearing the text field, which I imagine makes the cursor jump.

I don't understand why typing causes a selected event but clicking in the text field doesn't.  Maybe the bogus selected event is at fault.  On the other hand, I don't see why it's important to call setSourceName to add the path to the history list.  Simply deleting the call (as in this patch) seems to fix the bug.
Comment 2 Michael Valenta CLA 2007-04-03 13:50:16 EDT
Thanks for the patch
Comment 3 Michael Valenta CLA 2007-04-03 14:23:10 EDT
Patch released to HEAD. Thanks again.
Comment 4 Michael Valenta CLA 2007-04-26 09:57:57 EDT
Verified