Closed Bug 434504 Opened 16 years ago Closed 6 years ago

ontextentered function called whenever enter is pressed in autocomplete textbox

Categories

(Toolkit :: Autocomplete, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED INACTIVE

People

(Reporter: alex-mozillabug, Unassigned)

Details

(Keywords: testcase)

Attachments

(1 file)

329 bytes, application/vnd.mozilla.xul+xml
Details
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14

According to http://developer.mozilla.org/en/docs/XUL:Attribute:ontextentered, the given event handler is supposed to be called when a result is selected in an autocomplete textbox.  However, this event happens whenever enter is pressed in the textbox, regardless of whether something was selected or not.  This makes it impossible to tell if an autocomplete suggestion was selected or not.

Reproducible: Always

Steps to Reproduce:
1. Create an autocomplete textbox, such as the following:
   <textbox type="autocomplete" autocompletesearch="history" ontextentered="alert('suggestion selected');"/>
2. Load the page with the textbox, enter some text, select a suggestion with the arrow keys, and press enter.
3. In the same textbox, enter some text, do not select a suggestion, press enter.
Actual Results:  
In both cases (suggestion selected with enter and no suggestion selected) the alert is shown.

Expected Results:  
The alert should have been shown only in the first case.

Also happens in Firefox 3RC1.
Bulk closing all UNCONFIRMED bugs dealing with places that haven't had any bug activity in over 120 days, have no votes, and are not enhancement requests.

If you are still experiencing this issue in Firefox 3.0 or later, please re-open the bug with steps to reproduce (if they were not part of the original comment).
Status: UNCONFIRMED → RESOLVED
Closed: 16 years ago
Resolution: --- → INCOMPLETE
Just tested in Firefox 3.0.4, bug is still present.
Status: RESOLVED → UNCONFIRMED
Resolution: INCOMPLETE → ---
Reporter, are you still seeing this issue with Firefox 3.6.10 or later in safe mode or a fresh profile? If not, please close. These links can help you in your testing.
http://support.mozilla.com/kb/Safe+Mode
http://support.mozilla.com/kb/Managing+profiles
Whiteboard: [CLOSEME 2010-11-01]
Yes, this still happens in Firefox 3.6.10 with a new profile (and a simple extension with the above test installed - I have to be able to put the test file somewhere).
Attached file Simple testcase.
Added a simple testcase.  Has to be run from a privileged location.
No reply from reporter, INCOMPLETE. Please retest with Firefox 3.6.12 or later and a new profile (http://support.mozilla.com/kb/Managing+profiles). If you continue to see this issue with the newest firefox and a new profile, then please comment on this bug.
Status: UNCONFIRMED → RESOLVED
Closed: 16 years ago14 years ago
Resolution: --- → INCOMPLETE
Why did you close this?  I responded on 2010-10-06 14:00:23 PDT, comment #4.  This is still reproducible.
Status: RESOLVED → UNCONFIRMED
Resolution: INCOMPLETE → ---
Whiteboard: [CLOSEME 2010-11-01]
Version: unspecified → 3.6 Branch
Current docs: https://developer.mozilla.org/En/XUL/Textbox_%28Toolkit_autocomplete%29#a-ontextentered

Dao, could you comment if this is an issue with docs and, if so, what should be the correct description of ontextentered?
Component: Location Bar → Autocomplete
Keywords: testcase
Product: Firefox → Toolkit
QA Contact: location.bar → autocomplete
Version: 3.6 Branch → unspecified
I don't know what the original intent was, i.e. whether the implementation (in nsAutoCompleteController::EnterMatch) or the documentation is right, but changing the implementation would probably break the location bar...
The main issue is that there's no way to tell when a user selects an auto-complete suggestion, or typed and pressed the enter key.  Without it, you have to assume everything was typed in by the user, which means you always need to check the input.  If you could know it came from autocomplete, you wouldn't need to do the extra validation.

ontextentered does seem to be an odd name for this (you'd expect onitemselected or something).  Based on the description of ontextreverted however, I think this was the original intention.  IE: when an autocomplete item is chosen, you get ontextentered, and when it is rejected (by pressing escape) you get ontextreverted.  If you wanted to monitor for the enter key only, it seems like oncommand would be more appropriate.  I think the intention was "enter" in the sense of "enter data", versus meaning the "enter key".
Per policy at https://wiki.mozilla.org/Bug_Triage/Projects/Bug_Handling/Bug_Husbandry#Inactive_Bugs. If this bug is not an enhancement request or a bug not present in a supported release of Firefox, then it may be reopened.
Status: UNCONFIRMED → RESOLVED
Closed: 14 years ago6 years ago
Resolution: --- → INACTIVE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: