Closed Bug 244900 Opened 21 years ago Closed 19 years ago

autocomplete does not set focus before mousemove event

Categories

(SeaMonkey :: Location Bar, defect)

defect
Not set
minor

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: mozilla, Assigned: neil)

References

Details

Attachments

(1 file, 2 obsolete files)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040206 Firefox/0.8 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040206 Firefox/0.8 The selection in the autocomplete selection component appearing while typing in the location bar is not setting current focus if the mouse is not moved. If you do not move the mouse and click on the autocompleted item you want to use it is instead interbitated as "enter" or "go". Reproducible: Always Steps to Reproduce: 1. Place the cursor just below the location bar 2. Type anything that interduces the autocomplete-selection bar 3. Click the left ("action") mouse button. Actual Results: The browser navigates the to incomplete URL typed instead of the autocompleted URL actually clicked upon/selected. Expected Results: When the autocomplete bar appear it should look at the location on the mouse to determind initial selection. This is not a problem with the native selection component, ie. used in Internet Explorer
I have replicated this bug (244900) in Win XP Pro: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0.
Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8b2) Gecko/20050307 Confirm
Status: UNCONFIRMED → NEW
Ever confirmed: true
Attached patch patch (obsolete) — Splinter Review
Attachment #205469 - Flags: review?(db48x)
Assignee: location-bar → ajschult
OS: Windows XP → All
Hardware: PC → All
*** Bug 168623 has been marked as a duplicate of this bug. ***
Attachment #205621 - Flags: superreview?(jag)
Attachment #205621 - Flags: review?(iann_bugzilla)
Comment on attachment 205621 [details] [diff] [review] More extensive patch including some code simplification >Index: autocomplete.xml >=================================================================== . . > <handlers> > <handler event="mouseout" action="this.textbox.view.selectedIndex = null;"/> >- <handler event="mouseup" action="this.textbox.onResultClick();"/> >+ <handler event="mouseup"><![CDATA[ >+ this.textbox.view.selectedIndex = this.getHoverRow(event); >+ this.textbox.onResultClick(); >+ ]]></handler> Don't we need to test for (this.textbox.resultsPopup.selectedIndex == null) like in the original patch or this always the case?
*** Bug 192925 has been marked as a duplicate of this bug. ***
Attachment #205469 - Attachment is obsolete: true
Attachment #205469 - Flags: review?(db48x)
Comment on attachment 205621 [details] [diff] [review] More extensive patch including some code simplification With the patch applied, I get: JavaScript error: , line 0: uncaught exception: [Exception... "Not enough arguments [nsITreeBoxObject.getCellAt]" nsresult: "0x80570001 (NS_ERROR_XPC_NOT_ENOUGH_ARGS)" location: "JS frame :: chrome://global/content/autocomplete.xml :: getHoverRow :: line 1595" data: no]
*** Bug 193626 has been marked as a duplicate of this bug. ***
> JavaScript error: , line 0: uncaught exception: [Exception... "Not enough > arguments [nsITreeBoxObject.getCellAt]" nsresult: "0x80570001 + var row = this.textbox.view.treeBoxObject.getCellAt(x, y); should be getRowAt(x, y);
(In reply to comment #6) >>+ <handler event="mouseup"><![CDATA[ >>+ this.textbox.view.selectedIndex = this.getHoverRow(event); >>+ this.textbox.onResultClick(); >>+ ]]></handler> >Don't we need to test for (this.textbox.resultsPopup.selectedIndex == null) >like in the original patch or this always the case? I guess I should only call onResultClick if the index is not null. (In reply to comment #10) >>+ var row = this.textbox.view.treeBoxObject.getCellAt(x, y); >should be getRowAt(x, y); Doh :-[ Want a new patch?
(In reply to comment #11) > (In reply to comment #6) > >>+ <handler event="mouseup"><![CDATA[ > >>+ this.textbox.view.selectedIndex = this.getHoverRow(event); > >>+ this.textbox.onResultClick(); > >>+ ]]></handler> > >Don't we need to test for (this.textbox.resultsPopup.selectedIndex == null) > >like in the original patch or this always the case? > I guess I should only call onResultClick if the index is not null. > > (In reply to comment #10) > >>+ var row = this.textbox.view.treeBoxObject.getCellAt(x, y); > >should be getRowAt(x, y); > Doh :-[ > > Want a new patch? > Probably best.
Attached patch Revised patchSplinter Review
Assignee: ajschult → neil.parkwaycc.co.uk
Attachment #205621 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #206271 - Flags: superreview?(jag)
Attachment #206271 - Flags: review?(iann_bugzilla)
Attachment #205621 - Flags: superreview?(jag)
Attachment #205621 - Flags: review?(iann_bugzilla)
Comment on attachment 206271 [details] [diff] [review] Revised patch >Index: autocomplete.xml >=================================================================== >+ <method name="getHoverRow"> ... >+ var row = this.textbox.view.treeBoxObject.getRowAt(x, y); >+ if (row >= 0) >+ return row; > else >+ return null; nit: return after else sr=jag
Attachment #206271 - Flags: superreview?(jag) → superreview+
Comment on attachment 206271 [details] [diff] [review] Revised patch r=me with jags nit fixed :-)
Attachment #206271 - Flags: review?(iann_bugzilla) → review+
Fix checked in to the trunk.
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Note that bug 306538 fixed this problem in toolkit's autocomplete.xml by adding a mousedown handler: https://bugzilla.mozilla.org/attachment.cgi?id=194715&action=diff
(In reply to comment #17) >Note that bug 306538 fixed this problem in toolkit's autocomplete.xml by adding >a mousedown handler: OK, so who wants to come up with a list of (dis)advantages for down, up or both?
Product: Core → SeaMonkey
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: