private _getIcons()

in src/select/select.tsx [1152:1203]


  private _getIcons() {
    const {selected} = this.state;
    const {disabled, clear, hideArrow} = this.props;
    const icons = [];
    const height = this.getHeight();

    if (!Array.isArray(selected) && selected?.icon) {
      icons.push(
        <button
          title='Toggle options popup'
          type='button'
          className={styles.selectedIcon}
          key='selected'
          disabled={this.props.disabled}
          onClick={this._clickHandler}
          style={{backgroundImage: `url(${selected.icon})`}}
        />,
      );
    }

    if (clear && !disabled && !this._selectionIsEmpty()) {
      icons.push(
        <Button
          title='Clear selection'
          data-test='ring-clear-select'
          className={styles.clearIcon}
          key='close'
          disabled={this.props.disabled}
          onClick={this.clear}
          height={height}
          icon={closeIcon}
        />,
      );
    }

    if (!hideArrow) {
      icons.push(
        <Button
          title='Toggle options popup'
          className={styles.chevron}
          iconClassName={styles.chevronIcon}
          icon={chevronDownIcon}
          key='hide'
          disabled={this.props.disabled}
          height={height}
          onClick={this._clickHandler}
        />,
      );
    }

    return icons;
  }