Ticket #127 (closed defect: wontfix)

Opened 4 years ago

Last modified 4 years ago

Cursor loses focus in html view when textarea is wrapped in <label> (firefox 3 only)

Reported by: rostr Owned by: jf.hovinne
Priority: major Milestone: 0.5
Component: editor Version: trunk
Keywords: Cc:

Description

For some crazy reason, the html editor area loses focus immediately upon clicking inside it when the textarea is wrapped in a <label>

I've created an example below. The first editor is wrapped in a <label> and if you go to the html edit view you'll see that you can't make changes because it loses focus.

The second works just fine.

 http://www.naw.org/admin/badeditor.php

I'm running the recent beta release of wymeditor. Javascript console is not recording any errors or warnings.

Change History

comment:1 Changed 4 years ago by jf.hovinne

  • Status changed from new to closed
  • Resolution set to wontfix

Weird, but I found out what's happening.

From XHTML.com:
The label element associates a label with form controls such as input, textarea, select and object. This association enhances the usability of forms. For example, when users of visual Web browsers click in a label, focus is automatically set in the associated form control.

Actually, if you disable (with Firebug) the "display:none" put on the textarea 'replaced by' WYMeditor, and then click in the HTML view, you'll see that the first textarea gets the focus.

FYI, if you put the textarea outside the label, the 'bug' doesn't occur, since WYMeditor will be outside the label, which is more correct.

<label for='event_short_desc'>Short Description:</label>
<textarea class='wymeditor' name='event_short_desc' id='event_short_desc' cols='64' rows='8'></textarea>
<textarea class='wymeditor' name='event_short_desc' id='event_short_desc' cols='64' rows='8'></textarea>
Note: See TracTickets for help on using tickets.