Open garrett opened 6 years ago
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:
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.
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.
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.