Closed Bug 144503 Opened 22 years ago Closed 21 years ago

text field won't focus on click -- TV Listings on My Netscape

Categories

(Core :: DOM: UI Events & Focus Handling, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 194228

People

(Reporter: a-huntwork, Assigned: saari)

References

()

Details

Attachments

(1 file)

My Netscape just changed their TV Listings source from tvguide to AOLTV.  The
AOLTV content has a text field in which the user must enter his zip code.  This
text field cannot be focused by a mouse click.  The user must instead tab into
it.  This is not easy to discover, so this is a pretty annoying bug.

The textfield is generated with document.write("<input type=text...")
reassigning
Assignee: morse → rods
Component: Form Manager → HTML Form Controls
I see this as well using win xp trunk build 2002051408, marking new
Status: UNCONFIRMED → NEW
Ever confirmed: true
how exactly do I get the TV listings?  Do I need a my.netscape.com account?
-->
Assignee: rods → kin
Boris Zbarsky, I created one for you :-) TNobodyA (username) mozilla (password),
if you click my Netscape on the personal toolbar and then sign in with this
Username/password you will see tv listings on the left hand upper side
Attached file Minimal testcase
The textfield in this testcase cannot be focused.  I'm not sure that's correct,
but....
Terri, thanks for setting up that account.  :)

The site basically does:

document.onmousedown = engage;

function engage(evt){
  var evt = (evt) ? evt : (window.event) ? window.event : "";
  if (evt){
    var elem = (evt.target) ? evt.target : evt.srcElement
  }
  var elemID=elem.id;
  if ( elem.id.indexOf("searchid")!=-1)
  {
    return;
  }
  theService=elemID.substring(5);
  if (elemID.indexOf("move_")==-1) {winObj=null; return false;}
  winObj=d.getElementById('winDrag').style;
  winObj.left=evt.pageX- 50 + "px";
  winObj.top=evt.pageY + 20 + "px";
  winObj.width="200px";
  winObj.height="200px"
  winObj.display="";
  return false;
}

Now returning "false" from this onmousedown handler makes the textfield not take
focus, as in the attached testcase.  The only reason you can focus the search
field on that page is that it has |id="searchid"| and hence returns with a
non-false return value from this function.  The TV listings field has no id, so
|elemID.indexOf("move_")==-1| tests true and the handler returns false.

To events; I don't know whether not allowing textfields to get focused when the
onmousedown event is cancelled is correct....
Assignee: kin → joki
Component: HTML Form Controls → Event Handling
QA Contact: tpreston → rakeshmishra
Bob?  jst?  what's the correct behavior here?
Returning false from onmousedown and/or onmouseup does not prevent click from
firing. 

I don't see why returning false from onmousedown would prevent the field from
being focused. Neither IE or Opera will prevent the field form obtaining focus.
> I don't see why returning false from onmousedown would prevent the field from
> being focused.

Quite simply, because the field takes focus onmousedown (in all the browsers
involved; try it!).  So cancelling onmousedown's default action would logically
prevent the field from taking focus...

That said, I agree that compat with IE/NS4 is what we want here.
QA Contact: rakeshmishra → trix
.
Assignee: joki → saari
QA Contact: trix → ian
*** Bug 218389 has been marked as a duplicate of this bug. ***
OS: Linux → All
Hardware: PC → All
duplicate of more recent but much more straightforward bug 194228

*** This bug has been marked as a duplicate of 194228 ***
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → DUPLICATE
Component: Event Handling → User events and focus handling
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: