Defect #33392

Updated by Marius BALTEANU over 1 year ago

Below it's a snippet from @displayTabsButton()@ function:
<pre><code class="js">
var bw = $(el).parents('div.tabs-buttons').outerWidth(true);

if ((tabsWidth < el.width() - bw) && (lis.length === 0 || lis.first().is(':visible'))) {
} else {
el.find('div.tabs-buttons').show().children('').toggleClass('disabled', numHidden == 0);

Selector @parents('div.tabs-buttons')@ from line @var bw = $(el).parents('div.tabs-buttons').outerWidth(true);@ never finds any element because @div.tabs-buttons@ is not a parent of @div.tabs@.

On jQuery 2, @var gw = $(el).parents('div.tabs-buttons').outerWidth(true);@ is null which means 0+.
On jQuery 3, @var gw = $(el).parents('div.tabs-buttons').outerWidth(true);@ is undefined which means NaN.

Because of this change, the condition @(tabsWidth < el.width() - bw)@ always return false on jQuery 3 because @gw@ is NaN and tabsButton are displayed. Nan.

The attach patch fixes this incorrect behaviour and also replaces drops some inline styles with class @hidden@. styles.