Closed
Bug 480262
Opened 16 years ago
Closed 15 years ago
Removing/Deleting an auto-complete entry via shift+delete removes last character from the entered text inside a textbox
Categories
(Toolkit :: Autocomplete, defect)
Tracking
()
VERIFIED
FIXED
mozilla1.9.3a1
Tracking | Status | |
---|---|---|
status1.9.2 | --- | beta1-fixed |
People
(Reporter: whimboo, Assigned: asqueella)
References
Details
(Keywords: verified1.9.2)
Attachments
(1 file, 1 obsolete file)
3.61 KB,
patch
|
Gavin
:
review+
benjamin
:
approval1.9.2+
|
Details | Diff | Splinter Review |
Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1b3pre) Gecko/20090225 Shiretoko/3.1b3pre ID:20090225020421
The text which is entered by users on different websites will be stored and shown as proposal when a word with the same beginning letters is entered. Over time these lists get very long and even unwanted entries appear. The way to delete one of those entries is to use the up/down arraw keys to navigate through the list of proposed words and hit Shift+Delete. The underlying entry gets removed.
Sadly, it's not the only part which is deleted. It looks like that even when the auto-complete popup has processed the event, it is still propagated to the textbox itself. As result the last character is getting removed too.
Steps:
1. Enable "Remember what I enter in forms and the search bar" inside the preferences
2. Open Google home page and search for "Mozilla"
3. Go back and clear the textbox
4. Enter "Moz" in the textbox
5. Press the down arrow key once to select Mozilla
6. Press Shift+Delete
With step 6 not only the auto-complete entry is deleted from the list but also the "z" from "Moz". That shouldn't happen.
Reporter | ||
Updated•16 years ago
|
Summary: Removing/Deleting an auto-complete entry via shift+delete removes last character → Removing/Deleting an auto-complete entry via shift+delete removes last character from the entered text inside a textbox
Assignee | ||
Comment 1•16 years ago
|
||
While the event propagation also happens on non-mac OS, the "last character is getting removed too." issue is only noticeable on mac, where 'Delete' acts like backspace.
Version: 1.8 Branch → Trunk
Comment 2•16 years ago
|
||
gavin: The event isn't being canceled because autocomplete controller only says "cancel = true" if it automatically completes to the default index. Any idea why it doesn't just set _retval to true whenever it's able to RemoveValueAt ?
http://mxr.mozilla.org/mozilla-central/source/toolkit/components/autocomplete/src/nsAutoCompleteController.cpp#536
Comment 3•16 years ago
|
||
Only one of the changes is needed.... silly ifdefs...
Comment 4•16 years ago
|
||
Actually.. I didn't look at where it chooses to not handle removing the item if we're actually deleting from the middle of the text and not the end...
Comment 5•15 years ago
|
||
I think we should just take the first fix (always cancel in handleDelete).
Keywords: helpwanted
Assignee | ||
Comment 6•15 years ago
|
||
This bug affects: form fill on web pages (via satchel - nsFormFillController) and XUL <textbox type="autocomplete/> - the Location bar and the Search bar in particular (via autocomplete.xml). So indeed fixing this in nsAutocompleteController is better than doing this just in autocomplete.xml.
> I didn't look at where it chooses to not handle removing the item if
> we're actually deleting from the middle of the text and not the end...
Being in the middle of the text means the autocomplete popup is not open, so nsAutoCompleteController::HandleDelete returns early right after GetPopupOpen check.
Assignee: nobody → asqueella
Attachment #377046 -
Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #397450 -
Flags: review?(gavin.sharp)
Updated•15 years ago
|
Attachment #397450 -
Flags: review?(gavin.sharp) → review+
Comment 7•15 years ago
|
||
Comment on attachment 397450 [details] [diff] [review]
always cancel the event in nsAutoCompleteController::HandleDelete
>diff --git a/toolkit/components/satchel/test/test_form_autocomplete.html b/toolkit/components/satchel/test/test_form_autocomplete.html
>+ if (osString == "Darwin")
>+ doKey("back_space", shiftModifier);
>+ else
>+ doKey("delete", shiftModifier);
This isn't an issue with your changes, but there's no need for the shiftModifier in the "delete" case, given bug 241774.
Assignee | ||
Comment 8•15 years ago
|
||
Don't think so - the change from bug 241774 was undone in bug 325737.
Assignee | ||
Comment 9•15 years ago
|
||
Er, you're right that shiftModifier isn't needed in the case you quoted. This is because this line only runs on Win/Linux, not because of bug 241774. If you don't mind, I won't touch this, since I'm not testing on non-Mac.
Comment 10•15 years ago
|
||
(In reply to comment #9)
> because this line only runs on Win/Linux, not because of bug 241774
It's because of both :)
It's fine to just leave it as is.
Assignee | ||
Comment 11•15 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Comment 12•15 years ago
|
||
So this is not a problem when there are multiple entries?
Assignee | ||
Comment 13•15 years ago
|
||
Probably no, but I have no idea what problem you have in mind.
Comment 14•15 years ago
|
||
Comment on attachment 397450 [details] [diff] [review]
always cancel the event in nsAutoCompleteController::HandleDelete
Gavin explained to me on IRC that the bug's conditions are more common than I originally realised in which case I would appreciate a branch fix (for SeaMonkey) for what thus appears to be a medium reward low risk patch.
Attachment #397450 -
Flags: approval1.9.1.4?
Reporter | ||
Updated•15 years ago
|
Target Milestone: --- → mozilla1.9.3a1
Reporter | ||
Comment 15•15 years ago
|
||
Comment on attachment 397450 [details] [diff] [review]
always cancel the event in nsAutoCompleteController::HandleDelete
Then getting it fixed on 1.9.2 would be nice too.
Attachment #397450 -
Flags: approval1.9.2?
Reporter | ||
Comment 16•15 years ago
|
||
Verified fixed with Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.3a1pre) Gecko/20090831 Minefield/3.7a1pre ID:20090831030956
Updated•15 years ago
|
Attachment #397450 -
Flags: approval1.9.1.4?
Updated•15 years ago
|
Attachment #397450 -
Flags: approval1.9.2? → approval1.9.2+
Assignee | ||
Comment 17•15 years ago
|
||
I'm not sure when I'll get to checking it into 1.9.2, so if anyone has time to do that, please do.
I didn't check the patch applies cleanly, but it's simple, so there shouldn't be any problems.
Keywords: checkin-needed
Whiteboard: [1.9.2 landing needed]
Comment 18•15 years ago
|
||
Reporter | ||
Comment 19•15 years ago
|
||
Verified fixed on 1.9.2 with Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2a2pre) Gecko/20090915 Namoroka/3.6a2pre ID:20090915041724
You need to log in
before you can comment on or make changes to this bug.
Description
•