Closed Bug 345265 Opened 18 years ago Closed 12 years ago

Tab-focus behaviour different when closing a tab spawned via 'Undo Close Tab'

Categories

(Firefox :: Tabbed Browser, defect)

2.0 Branch
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 530203

People

(Reporter: tommyjb, Unassigned)

References

Details

(Keywords: uiwanted)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1b1) Gecko/20060719 BonEcho/2.0b1
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1b1) Gecko/20060719 BonEcho/2.0b1

1. Ensure that you have at least two tabs open (it doesn't matter whether or not they're blank).
2. Focus the very first tab you have open.
3. Open a new tab with focus (for example, by pressing Ctrl+T or equivalent).
4. Navigate to any web site.
5. Close the current tab.

Focus now switches to the first tab you have open, as expected.

However, now do the following:

1. Right-click the tab bar and select 'Undo Close Tab'.
2. Close the current tab.

Focus now switches to the rightmost tab -- *not* the first tab you have open, as before.

Is this intended?  It seems a little inconsistent.

Reproducible: Always
OS: Windows XP → All
I would expect it to focus the first tab in this case, because reopening a closed tab is a temporary other task.
Flags: blocking-firefox2?
plussing to evaluate what the correct behaviour should be here, and whether this is a bug.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: blocking-firefox2? → blocking-firefox2+
Keywords: uiwanted
This bug is actually more complex that parent/no parent, since there's also the question of whether we should focus the reopened tab.

This is probably closer to the right thing, but we can refine this better in Fx3
Flags: blocking-firefox2+ → blocking-firefox2-
Target Milestone: --- → Firefox 3 alpha1
(In reply to comment #3)
> there's also the
> question of whether we should focus the reopened tab.
Reopened tab should have focus as it has now - user needs to be sure that he reopened the proper tab or just use it after reopening.
If first tab was the last focused tab before reopening then after closing the reopened tab -> first tab should have focus back.
FLST extension - http://gorgias.de/mfe/#flst or Focus Last Selected Tab -
http://www.gozer.org/mozilla/extensions/ are fixing this bug as they do with Bug 344508 (with these bugs fixed I could have 1 extension less on the profile ;)

> This is probably closer to the right thing, but we can refine this better in
> Fx3
Fx3 beta is not far away so maybe now it's the time :)
Is this still targeted for Firefox 3?
Flags: blocking-firefox3?
Nope, doesn't block Firefox 3, but bumping to wanted ...
Flags: wanted-firefox3+
Flags: blocking-firefox3?
Flags: blocking-firefox3-
Hardware: x86 → All
Target Milestone: Firefox 3 alpha1 → ---
Version: unspecified → 2.0 Branch
The STR in comment #0 were a little confusing, so hopefully these steps are clearer (and are what comment #0 was trying to explain):

1) Open a new window
2) Open three tabs
3) Give focus to the third tab
4) Close the first tab using the X on the tab so the focus stays on the third tab
5) Right click on a tab and choose "Undo Close Tab"
6) Note that focus switches to the first tab
7) Close the first tab

Expected:
8a) The tab focus switches back to the third tab

Actual:
8b) The tab focus switches to the second tab
(In reply to Jared Wein [:jaws] from comment #8)
> The STR in comment #0 were a little confusing, so hopefully these steps are
> clearer (and are what comment #0 was trying to explain):
> 
> 1) Open a new window
> 2) Open three tabs
> 3) Give focus to the third tab
> 4) Close the first tab using the X on the tab so the focus stays on the
> third tab
> 5) Right click on a tab and choose "Undo Close Tab"
> 6) Note that focus switches to the first tab
> 7) Close the first tab
> 
> Expected:
> 8a) The tab focus switches back to the third tab
> 
> Actual:
> 8b) The tab focus switches to the second tab

That behavior is no different than if you just switch tabs from 3 to 1, then close 1. (in other words, take out steps 4 & 5)

I think we should close this in favor of a bug (I know it exists _somewhere_, maybe bug 530203?) to just improve the heuristics of all this tab switching stuff.
Yes, let's do that. You pointed to the bug I wanted to point to.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → DUPLICATE
Cut/paste error.
You need to log in before you can comment on or make changes to this bug.