Closed Bug 102598 Opened 23 years ago Closed 23 years ago

new tabs created with Ctrl-T should give focus to the location bar like Ctrl-N

Categories

(SeaMonkey :: Tabbed Browser, defect)

x86
Windows 98
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED
mozilla1.0

People

(Reporter: moku_, Assigned: hyatt)

References

(Blocks 1 open bug)

Details

Attachments

(5 files)

2001093008

Summary says it all.
Blocks: 55416
See also bug 37638, Ctrl+N shouldn't focus location bar in the new window.
This would be nice, as the first thing I'm going to do after opening a new tab
is to type in a URL to go to.
In response to the reference to 37638 -

To make the browser understand the difference between "about:blank"/"" and a
real page (and thus give focus to the appropriate element) would require much
more code, and I believe that this is covered by / could be snowballed into
37638 (or be put into a new bug.)
However, it'd be very simple for a new tab to just give focus to the location
bar for consistency with New Window until someone works up a fix for 37638, and
that's what this bug was filed for.
My patch satisfies me, the reporter, in that it behaves as I would have expected
a fix for this to ... whether or not the code is viable is a whole different
story :) ... (just copy/pasted the code from Startup to BrowserOpenTab)

Context|Open In New Tab gives focus to the content area, and Accel-T gives focus
to the location bar, just like Accel-N/Open In New Window.
For tabs you don't need all the complicated setTimeout stuff.  You can just set
focus right to the URL bar.
Comment on attachment 52265 [details]
same as v2 but with better comments

Looks fine to me.

r=hwaara
Attachment #52265 - Flags: review+
It's even easier than that.  You literally need only this line.

gURLBar.focus();
I'm warning you, no sharp objects ... you'll be sorry ... :)
Comment on attachment 52270 [details]
hyatt tells me how to write em, I just do what he says

this looks even better ;)

r=hwaara
Attachment #52270 - Flags: review+
adding approval keyword
Keywords: approval
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla1.0
so BrowserOpenTab never gets called in any situation where the user may prefer 
the content area to take focus?

Fixed.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
buildt with the patch on linux:
URL-bar in tabs opened with ctrl+t display about:blank and do not have focus.
Oops.. This works just fine, one build later. Patch was in the first time, but i
didn't clobber. Guess something didn't build right.
Actually it's not like Ctrl-N now, because when you use Ctrl-N the location bar
not only gets focus, but URL in location bar is selected (so you can start
typing new URL).

Or should I file another bug on this ? 
pkures:

Yes, if you're seeing that behavior, I'd file a different bug and just reference
this one in a comment.

Also, make sure to report your platform and build, because I can't reproduce
this error on win32.  (The location in the url bar properly gets selected, so
you can type immediately.)
pkures: garretta@garretta.com beat you too it.  Bug 104478 covers the fact that 
Ctrl+T doesn't select the location bar contents when it focuses the location 
bar.
QA Contact: blakeross → sairuh
imo, accel+N shouldn't focus the urlbar [referred to in comment 1], unless
about:blank is loaded. since that's the case with accel+T, however, i'll mark
this vrfy'd [tested with 2001.11.28.0x-comm bits on linux rh7.2, mac 10.1.1 and
winnt].
Status: RESOLVED → VERIFIED
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: