Last modified: 2013-07-31 22:20:17 UTC
When you click or Tab to the Summary field in the edit window, the browser's functionality is to highlight the entire summary field, including the automatically-generated /* Section title */ bit.
Ideally, it would only highlight the part *after* the section title so you can just start typing instead of overwriting the auto-generated section title or using the mouse or arrow keys to navigate past the section heading.
More details including code at the URL.
Created attachment 3645 [details]
Here's a quickie attempt at it... some caveats:
First, it doesn't seem to be working in Internet Explorer at all. The event fires, but text selection seems to work differently there; there's some other code dealing with that for the edit toolbar stuff, but I don't feel like diving in it just now.
The code above does seem to work in Firefox 2.0.3, Safari 2.0.4, and Opera 9.20.
Second, it might be desirable to tweak the behavior a bit. Normally the "select all text" behavior only happens when you _tab_ into a field; clicking usually positions the caret and doesn't set a selection. The onclick or onfocus events change the behavior more than I'd prefer, by setting a selection when I'm just trying to position the cursor.
Checking for the previously-set selection, eg if it's the whole text, might do the trick nicely.
*Bulk BZ Change: +Patch to open bugs with patches attached that are missing the keyword*
Setting "patch-reviewed" keyword as comment 1 lists more work that needs to be done for that patch.
Getting it into Gerrit would be welcome, I guess.
Not sure if this is worth the trouble, and the change in behavior will be probably more annoying than the behavior itself. I recomment WONTFIX.
(In reply to comment #4)
> I recomment WONTFIX.
I recommend the same. How a browser behaves when tabbing a form is not the responsibility of the website. How the tab key behaves depends on the operating system, on the browser and if and what kind of assisting software (screenreaders and such) is used. A script will actually break the expected behavior in some cases.
The only "right" way to do this is a HTML attribute. This acts as a recommendation and will not break existing workflows. Browsers can choose to ignore it. HTML5 added a lot of similar features to forms. But I'm afraid a feature to change the behavior of the tab key was not added.
Frankly I'd sooner say that "/* Section title */" should be automatically added always and not included in the summary text area.
(In reply to comment #6)
> Frankly I'd sooner say that "/* Section title */" should be automatically
> added always and not included in the summary text area.
That might be annoying e.g. if you edit the last section to modify categories, bottom templates or language links – none of these actually have to apply to the section (which might be called, say, "References").