Previously-selected tab should be selected when closing a tab.

NEW
Unassigned

Status

--
enhancement
8 years ago
8 years ago

People

(Reporter: gunnyj6, Unassigned)

Tracking

SeaMonkey 2.0 Branch

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

8 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.1.12) Gecko/20100825 SeaMonkey/2.0.7
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.1.12) Gecko/20100825 SeaMonkey/2.0.7

Current undesirable behavior of SeaMonkey focuses the tab immediately to the left (or to the right, if the closed tab was thee leftmost) of a tab that's been closed. Instead, the previously-selected tab should be focused.

Reproducible: Always

Steps to Reproduce:
1. Open at least three tabs
2. Select the first one
3. Select the last one, then close it.
Actual Results:  
Focus goes to the second one.

Expected Results:  
Focus should go back to the first one.
(Reporter)

Updated

8 years ago
Version: unspecified → SeaMonkey 2.0 Branch
(Reporter)

Comment 1

8 years ago
New info: The above behavior is only present when "Switch to new tabs opened from links" is not checked.
(Reporter)

Comment 2

8 years ago
MozillaZine user amrad posted the following, which is a detailed and accurate description of SeaMonkey's inconsistent behavior when closing tabs:

1.
With Switch to new tabs opened from links checked.
View tab A.
Open new tabs B & C.
Go to A.
Open a link from A into a new tab D.
Close D.
Focus returns to A.

2.
With Switch to new tabs opened from links unchecked.
View tab A.
Open new tabs B & C.
Go to A.
Open a link from A into a new tab D.
Close D.
Focus goes to tab C to the left of D.

3.
With Switch to new tabs opened from links checked or unchecked.
View tab A.
Open new tabs B & C.
Go to A.
Open a link from A into a new tab D.
Go to A.
Go to D.
Close D.
Focus goes to tab C to the left of D.

4.
With Switch to new tabs opened from links checked or unchecked.
View tab A.
Open new tabs B, C & D.
Open new tab E either from a link or not from a link.
Go to A.
Go to D.
Close D.
Focus goes to tab E to the right of D.

Updated

8 years ago
Severity: normal → enhancement
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Windows XP → All
Hardware: x86 → All
Just for clarification: This is not about the browser.tabs.selectOwnerOnClose pref (which is currently not supported by SM), which would be selecting the parent tab of a tab opened through a click on a link.

Comment 4

8 years ago
The thinking here is that if you open a tab from a link and it auto-selects and you then close the tab you probably want to go back to the tab from which you opened it. But once you start opening multiple tabs, or opening them in the background, or switching between tabs, then trying to second-guess the user is usually a bad idea.

That said, the previously selected tab is probably one of the hottest choices of tab to select. And we already have code that selects the previously selected tab when closing a tab that you just auto-opened from it, so it wouldn't be too much work to create a hidden preference which made this work for all tabs.

The big question of course is when should we forget the previously selected tab. We should of course forget it when we close the tab itself, but what about if we open or close other tabs? I think those operations should probably still forget the previously selected tab. That still means that if you switch to a tab, and then decide you don't want that tab, you can close it and we'll switch right back for you.

Comment 5

8 years ago
Anybody know how Firefox behaves?
(Reporter)

Comment 6

8 years ago
Firefox behaves in the same way, if bug 217563 is still valid. 

Opera seems to remember multiple previous tabs. If you have A, B, C, and D open and go from A to C to D, then close C before closing D, it'll go to A when you close D.
(Reporter)

Comment 7

8 years ago
I've been away for a while, but now I'm back. 

Latest stable SeaMonkey (Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14) behaves the same as before, no changes.

I actually tried FF4 and was impressed, so now I have it to test against this. It behaves slightly better, probably because it opens new tabs next to the current one if they're opened by middle-clicking a link:

Case 1: Same as SeaMonkey, however in FF D opens to the right of A rather than at the end as in SeaMonkey.

Case 2: Focus returns to A as expected. Again, D is to the right of A.

Case 3: Same as SeaMonkey above.

Case 4: Same as SeaMonkey above.

Comment 8

8 years ago
> Case 1: Same as SeaMonkey, however in FF D opens to the right of A rather than
> at the end as in SeaMonkey.

In SeaMonkey 2.1 we now open related tabs immediately to the right like Firefox 4.0.

Please test against 2.1 which should be out next week. Or if you can't wait our nightlies are available:
<https://wiki.mozilla.org/SeaMonkey/Bug_events/20110518#Install_the_latest_SeaMonkey_2.1_nightly>
(Reporter)

Comment 9

8 years ago
Ah, so it does. SeaMonkey 2.1 behaves exactly like Firefox.
You need to log in before you can comment on or make changes to this bug.