Ticket #7040 (closed bug: fixed)

Opened 4 years ago

Last modified 3 years ago

button class change breaks icon only buttons

Reported by: nefiga@… Owned by:
Priority: minor Milestone: 1.8.11
Component: ui.button Version: 1.8.10
Keywords: Cc:
Blocking: Blocked by:

Description

new jquery 1.8.10 has a problem with the multiple classes change for buttons ( https://github.com/jquery/jquery-ui/commit/d6fa44a0b4c5bf08f31040f9008e8fb54b36db02).

I can see the problem in the code here:

buttonClasses.push( multipleIcons ? "ui-button-icons-only" : "ui-button-icon-only" ); buttonElement.removeClass( "ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary" );

Problem is, now that .push() is being used instead of .addClass(), the .removeClass() doesn't remove, for example, the ui-button-text-icon-primary class from an icon only button, because it hasn't been added yet. This results in the icon being off-center. To fix, maybe move the .removeClass call down below to after the classes have been added so it's properly removed, or else splice the buttonClasses array to get rid of the offending classes? I'm sure you'll come up with a better idea.

Thanks for the great product!

Change History

comment:1 Changed 4 years ago by scott.gonzalez

comment:2 Changed 4 years ago by Scott González

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

Button: Only add text classes if there is text. Fixes #7040 - button class change breaks icon only buttons.

Changeset: e72afe4afca0795fc785114cfeafbe08f5e2fdf3

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

Button: Only add text classes if there is text. Fixes #7040 - button class change breaks icon only buttons. (cherry picked from commit e72afe4afca0795fc785114cfeafbe08f5e2fdf3)

Changeset: c9bbd9aa6e8bd23e314f4e284aec3b18c6ad797c

comment:4 Changed 4 years ago by scott.gonzalez

  • Milestone changed from 1.9 to 1.8.11

comment:5 Changed 3 years ago by rdworth

#7038 is a duplicate of this ticket

comment:6 Changed 3 years ago by scott.gonzalez

#7099 is a duplicate of this ticket.

comment:7 Changed 3 years ago by scott.gonzalez

#7097 is a duplicate of this ticket.

comment:8 Changed 3 years ago by rdworth

#7116 is a duplicate of this ticket.

Note: See TracTickets for help on using tickets.