Ticket #6262 (closed bug: fixed)

Opened 3 years ago

Last modified 3 years ago

buttonset not applying ui-corner to invisible elements

Reported by: goldy Owned by:
Priority: major Milestone: 1.8.7
Component: ui.button Version: 1.8.5
Keywords: Cc:
Blocking: Blocked by:

Description

I'm using jquery UI tabs , on every tab i have 2 radios in a buttonset. The init of the buttonset is in the document ready function. On the current active tab the buttons are with rounded corners as they should be, but when i change the tab suddenly the buttonset is not with rounded corners, but if I refresh the buttons become rounded. I think the problem appears because probably the widget doesn't add Class .ui-corner to invisible items.

in 1.8.5 full min js on line 354

a.widget("ui.buttonset",{_create:function(){this.element.addClass("ui-buttonset");this._init()},_init:function(){this.refresh()},_setOption:function(b,c){b==="disabled"&&this.buttons.button("option",b,c);a.Widget.prototype._setOption.apply(this,arguments)},refresh:function(){this.buttons=this.element.find(":button, :submit, :reset, :checkbox, :radio, a, :data(button)").filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right")'''.filter(":visible")'''.filter(":first").addClass("ui-corner-left").end().filter(":last").addClass("ui-corner-right").end().end().end()},

Change History

comment:1 Changed 3 years ago by goldy

the bug is ported to 1.8.6. same issue.

i just saw a closed bug http://bugs.jqueryui.com/ticket/5946 which is strange for me, because the case is kinda very private. He want to hide certain buttons from a button set. for me the solution should not be so general for all buttonsets and buttons. If he wants to hide specific button he should add a class ui-helper-hidden or better to implement some kind of functionality in ui.button and ui.buttonset to hide button ex.

$("#mybutton").button('hide');

like disable

$("#mybutton").button('disable');

and for buttonset we should have a possibility to add as parameter an array with buttons to show or to hide

$("#mybuttonset").buttonset({
 hide:[0,3,5],
 show:[1,2,4]
}); 
Last edited 3 years ago by goldy (previous) (diff)

comment:2 Changed 3 years ago by scott.gonzalez

  • Priority changed from minor to major
  • Milestone changed from TBD to 1.9

We can fix this by adding an items option to define the selector to use for finding buttons and revert back to not filtering down to only visible elements. Then the use case in #5946 can be accomplished by providing a custom selector that limits to visible elements. Having hidden buttonsets initialize properly is probably more important than having individually hidden button elements handled by default.

comment:3 Changed 3 years ago by Scott González

  • Status changed from new to closed
  • Resolution set to fixed

Buttonset: Added items option and removed visible filter for adding rounded corners. Fixes #6262 - buttonset not applying ui-corner to invisible elements.

Changeset: 5dad57e3c2001b6c644e3c39798198bc34fa1e5d

comment:4 Changed 3 years ago by scott.gonzalez

  • Milestone changed from 1.9 to 1.8.7
Note: See TracTickets for help on using tickets.