eoger / tabcenter-redux

Vertical Tabs extension for Firefox
Mozilla Public License 2.0
381 stars 67 forks source link

Opening a new tab scrolls to the bottom, not the new tab #163

Open kumar303 opened 6 years ago

kumar303 commented 6 years ago

To reproduce

What happens:

The new tab is created immediately after the one you were on but the tab list scrolls to the bottom as if a new tab was created at the bottom.

What should happen:

The tab list should not be scrolled to the bottom. Maybe there is some code that is scrolling to the bottom? Can it just select the newly created tab instead?

benmullins commented 6 years ago

Always Right and Open Tabs Next to Current achieve the desired final tab position by moving the new tab to the position after the current tab. This means that the new tab is briefly at the end of the list, and Tab Center Redux scrolls to keep up with it. The issue is that Tab Center Redux doesn't scroll back; the native Firefox tab bar does do so, so the issue is less noticeable there than it is when using Tab Center Redux.

I don't know if there's an easy way to address this, but I hope that there is. I think that vertical tabs appeal to people who have a lot of them open, and these extensions to keep new tabs near what you're currently focused on do as well. It would be nice if they played together nicer.

kumar303 commented 6 years ago

Tab Center Redux scrolls to keep up with it

Oh really? Do you or anyone know where in the code that happens?

benmullins commented 6 years ago

No. I'm just inferring this based on what I know about the behavior of the other extensions. Rather than just creating a new tab in place, the new tab is created in its normal position at the end of the list and then moved to its destination immediately after the previously open tab. Since after all of this, Tab Center Redux is scrolled all the way to the bottom, I'm just making an assumption that it happens at that point.

kumar303 commented 6 years ago

If it's happening in Tabcenter Redux then it would be easy to fix! If it's happening in the WebExtensions tab API code then it would be harder to fix.

Keith94 commented 6 years ago

Good news! The preference browser.tabs.insertAfterCurrent was finally implemented. It will open new tabs after the current tab without the scrolling issue described above. :)

The new API will be used in Always Right: see https://github.com/autonome/Always-Right/issues/22

Keith94 commented 6 years ago

So, this will now be fixed for Firefox 61 and later.