Closed Bug 255116 Opened 20 years ago Closed 19 years ago

Pressing Home or Shift+Home should close autocomplete

Categories

(Firefox :: Address Bar, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox1.5

People

(Reporter: jruderman, Assigned: jruderman)

References

Details

(Keywords: dataloss)

Attachments

(1 file, 1 obsolete file)

Steps to reproduce: 1. Ctrl+L. 2. Type part of a URL. 3. Down. (select first autocomplete entry) 4. Shift+Home. (select to beginning of line) 5. Shift+Delete. (cut) Result: The autocomplete entry is removed. Expected: The selection is placed on the clipboard (and deleted from the address bar). I hit this several times in a row before figuring out what was going on.
thanks, that helped me to delete some entries in my autocomplete-list I think that is not a bug.
Joerg: can you elaborate? How did the ability to remove autocomplete entries after editing them help?
The problem here is that Shift-Delete is an old DOS equivalent for "Cut" or Ctrl+X. That shortcut is used to delete the entry and not cut the url to the clipboard. Whether or not this is worth fixing is debatable IMO, as relatively few use the old Shift+Del for cut.
Gavin, that's not the problem. The problem is that Shift+Delete still deletes the autocomplete entry *after* you perform selection/editing comments on the autocompleted URL.
Reading comment 0, I think my interpretation is correct. The reporter expected that "The selection is placed on the clipboard", where the selection is the selected URL text. He was expecting it to be a regular "cut" of the URL, and got a deleted autocomplete entry instead.
Err, didn't notice that you're the reporter. Nevermind my above comment then. It still wasn't explained clearly.
(In reply to comment #4) > Gavin, that's not the problem. The problem is that Shift+Delete still deletes > the autocomplete entry *after* you perform selection/editing comments on the > autocompleted URL. So, if I understand correctly, the most appropriate fix would be to make "Home" act like "Left Arrow" (hide the popup)? That would make it impossible to select text with the dropdown open, therefore avoiding the problem. I can't see any other possible solution, since the "selection/editing" shortcut you're using (Shift+Del) already has another function in our UI.
This bug is slowly driving me insane.
Blocks: 241774
Flags: blocking-aviary1.1?
The solution I was thinking of was to change some hidden state when you start editing so that Shift+Del (or, once bug 241774 is fixed, Del) acts on the text rather than on the autocomplete entry. But Gavin's solution, closing the autocomplete dropdown when you start navigating/selecting, sounds more sane than having hidden state, and is consistent with the current behavior for the left arrow key.
So, this isn't a "blocker" per se, since its really really low-impact, and unknown risk. If you want to try a fix, the window is about a week and a half really.
Flags: blocking-aviary1.1? → blocking-aviary1.1-
Assignee: bugs → jruderman
This might just be a simple fix in nsAutoCompleteController::HandleKeyNavigation at http://lxr.mozilla.org/mozilla/source/toolkit/components/autocomplete/src/nsAutoCompleteController.cpp#424. Untested pseudopatch: } else if (aKey == nsIAutoCompleteController::KEY_LEFT || - aKey == nsIAutoCompleteController::KEY_RIGHT) + aKey == nsIAutoCompleteController::KEY_RIGHT || + aKey == nsIAutoCompleteController::KEY_HOME) {
Summary: Shift+delete to delete autocomplete entries is still active after editing commands → Pressing Home or Shift+Home should close autocomplete
Version: 1.0 Branch → Trunk
Attached patch patch (obsolete) — Splinter Review
I've tested this on Windows, seems to work fine.
Attachment #191792 - Flags: review?(mconnor)
Oh, I forgot to change the comment just below the change in nsAutocompleteController.cpp, I've changed it to: // The user hit "Home" or the left or right arrow key
OS: Windows XP → All
Hardware: PC → All
Target Milestone: --- → Firefox1.1
Comment on attachment 191792 [details] [diff] [review] patch please get some testing on Mac/Linux before getting approval.
Attachment #191792 - Flags: review?(mconnor) → review+
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8b4) Gecko/20050806 Firefox/1.0+ Works on Linux, too. :)
On Mac, the Home key only affects the scroll position, and it doesn't do anything in the address bar. So the second hunk should probably get an #ifndef XP_MACOSX.
I haven't tested this yet; I'm rebuilding now to test on Mac.
Attachment #191792 - Attachment is obsolete: true
Attachment #191862 - Flags: review?(mconnor)
Compiles and does the right thing on Mac (no difference in behavior from not having the patch).
*** Bug 298689 has been marked as a duplicate of this bug. ***
Attachment #191862 - Flags: review?(mconnor)
Attachment #191862 - Flags: review+
Attachment #191862 - Flags: approval1.8b4+
Checking in components/autocomplete/src/nsAutoCompleteController.cpp; /cvsroot/mozilla/toolkit/components/autocomplete/src/nsAutoCompleteController.cpp,v <-- nsAutoCompleteController.cpp new revision: 1.32; previous revision: 1.31 done Checking in content/widgets/autocomplete.xml; /cvsroot/mozilla/toolkit/content/widgets/autocomplete.xml,v <-- autocomplete.xml new revision: 1.44; previous revision: 1.43 done
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
*** Bug 230677 has been marked as a duplicate of this bug. ***
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: