Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closing tabs shifts tab width #10

Open
garrett opened this issue Dec 11, 2017 · 2 comments
Open

Closing tabs shifts tab width #10

garrett opened this issue Dec 11, 2017 · 2 comments

Comments

@garrett
Copy link

garrett commented Dec 11, 2017

We had this bug at some times in our theme implementation too, especially when tab widths are forced:

When you're closing a tab and the mouse is still over the tab strip, the tab widths change, so you're not necessarily over the next tab. This can cause someone closing a lot of tabs in a row (either when using the X button or middle-clicking a tab) a bit of a problem, as the tabs will have shifted and they might close the wrong tab.

@lunakurame
Copy link
Owner

Looks like our CSS is fighting with Firefox' JS. The theme overrides max-width while JS is trying to set max-width too. I fixed it by letting JS do its thing, except for one specific case:

  1. Open 4 tabs (or any higher number of tabs, but not enough to let them scroll).
  2. Activate the second to last tab.
  3. Close it.
  4. Close the last tab.

For some reason it shrinks all tabs to exactly 100px and closing any tabs doesn't fix it until you move your mouse out of the tab bar. Instead of this weird behavior, I made it reset the tab width back to 100%, so unfortunately it still resizes the remaining tabs, but when you move your mouse and keep closing, it works okay, so I think that's less broken than forcing all tabs to resize to 100px. All other cases I checked work OK.

I don't really know how to fix that one scenario, because JS calculates the tab width we want to keep when closing tabs, but when JS resets it to 100px, we lose that info. I'll tag this issue with "help wanted" and leave it open, maybe someone figures it out.

@lunakurame lunakurame added this to the Firefox 57 milestone Dec 16, 2017
@lunakurame lunakurame removed their assignment Dec 16, 2017
@smithfred
Copy link

I think this is an artefact of Firefox's intended behaviour of always putting the next tab close button under the cursor when closing a tab (so that multiple tabs can be closed by just continually clicking).

Mousing away from the tab bar then presumably stops using the temporary JS tricks, reverting to the styled widths.

If you close the right-most tab, then there is no "next tab to the right", so presumably the JS just temporarily shrinks the remaining ones to Firefox's "standard" width.

FWIW, the "smart width" behaviour has always had a bug since its introduction to Firefox - with the standard theme, if you open enough tabs to scroll, then start closing them from the leftmost, when the scroll buttons disappear, the mouse is no longer over the next tab's close button.

@lunakurame lunakurame modified the milestones: Firefox 59, Firefox 60 May 18, 2018
@rafaelmardojai rafaelmardojai removed this from the Firefox 60 milestone Apr 20, 2019
andrew-ls pushed a commit to andrew-ls/firefox-gnome-theme that referenced this issue Oct 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants