private _renderPopup()

in src/select/select.tsx [695:761]


  private _renderPopup() {
    const anchorElement = this.props.targetElement || this.node;
    const {showPopup, shownData} = this.state;
    // eslint-disable-next-line no-underscore-dangle
    const _shownData = this._prependResetOption(shownData);
    const activeIndex = this._getActiveIndex(_shownData);

    return (
      <I18nContext.Consumer>
        {({translate}) => {
          let message;

          if (this.props.loading) {
            message = this.props.loadingMessage ?? translate('loading');
          } else if (!shownData.length) {
            message = this.props.notFoundMessage ?? translate('noOptionsFound');
          }

          return (
            <SelectPopup<SelectItemData<T>>
              data={_shownData}
              message={message}
              toolbar={showPopup && this.getToolbar()}
              topbar={this.getTopbar()}
              loading={this.props.loading}
              activeIndex={activeIndex}
              hidden={!showPopup}
              ref={this.popupRef}
              maxHeight={this.props.maxHeight}
              minWidth={this.props.minWidth}
              directions={this.props.directions}
              className={this.props.popupClassName}
              style={this.props.popupStyle}
              top={this.props.top}
              left={this.props.left}
              offset={this.props.offset}
              filter={this.isInputMode() ? false : this.props.filter} // disable popup filter in INPUT mode
              filterIcon={this.props.filterIcon}
              filterRef={this.props.filterRef}
              multiple={this.props.multiple}
              filterValue={this.state.filterValue}
              anchorElement={anchorElement}
              onCloseAttempt={this._onCloseAttempt}
              onOutsideClick={this.props.onOutsideClick}
              onSelect={this._listSelectHandler}
              onSelectAll={this._listSelectAllHandler}
              onFilter={this._filterChangeHandler}
              onClear={this.clearFilter}
              onLoadMore={this.props.onLoadMore}
              isInputMode={this.isInputMode()}
              selected={this.state.selected}
              tags={this.props.tags}
              compact={this.props.compact}
              renderOptimization={this.props.renderOptimization}
              ringPopupTarget={this.props.ringPopupTarget}
              disableMoveOverflow={this.props.disableMoveOverflow}
              disableScrollToActive={this.props.disableScrollToActive}
              dir={this.props.dir}
              onEmptyPopupEnter={this.onEmptyPopupEnter}
              listId={this.listId}
              preventListOverscroll={this.props.preventListOverscroll}
            />
          );
        }}
      </I18nContext.Consumer>
    );
  }