Search.../

iconCollapsed

Indicates if the button’s icon is collapsed or expanded.

Description

If iconCollapsed is true, the icon isn't displayed in the button under any circumstances.

If iconCollapsed is false, the icon is displayed unless the icon's button is hidden or collapsed.

To set the iconCollapsed property on an element, use the element's collapseIcon() and expandIcon() functions.

Note:

  • A collapsed icon doesn't take up any space in the button.
  • If you delete a button's icon, iconCollapsed retains the deleted icon's final state.

Type:

booleanRead Only

Related Content:

Was this helpful?

Check if a button's icon is collapsed

Copy Code
1let iconStatus = $w('#myButton').iconCollapsed; // true
Expand a button's icon if it's collapsed

Copy Code
1if ($w('#myButton').iconCollapsed) {
2 $w('#myButton').expandIcon();
3}
Display tooltip text when hovering over a button if its icon is displayed

Copy Code
1$w('#myButton').onMouseIn( (event) => {
2 // check if an icon exists and is displayed
3 if($w('#myButton').icon && !$w('#myButton').iconCollapsed){
4 // display a text box with tooltip instructions relating to the icon
5 $w('#tooltipText').expand();
6 }
7});