How can I change react-modal lib tabIndex?

68 Views Asked by At
<div class="ReactModal__Content ReactModal__Content--after-open layouts_reactModal__RKLdX" tabindex="-1" role="dialog" aria-modal="true">

I use react-modal lib.

I wanna change tabIndex another number (ex. 1, 2...)

because a button Fn active when user press 'Enter' in the modal

so How can i do?

1.

var contentProps = _extends({
        id: id,
        ref: this.setContentRef,
        style: _extends({}, contentStyles, this.props.style.content),
        className: this.buildClassName("content", className),
        // tabIndex: "-1",
        onKeyDown: this.handleKeyDown,
        onMouseDown: this.handleContentOnMouseDown,
        onMouseUp: this.handleContentOnMouseUp,
        onClick: this.handleContentOnClick,
        role: this.props.role,
        "aria-label": this.props.contentLabel
      }, this.attributesFromObject("aria", _extends({ modal: true }, this.props.aria)), this.attributesFromObject("data", this.props.data || {}), {
        "data-testid": this.props.testId
      });

I just tried to annotate tabIndex Line..

and I can't find 'enforcefocus'.

2.

<ReactModal
      isOpen={OpenEvent}
      onRequestClose={CloseEvent}
      shouldCloseOnEsc={true}
      shouldCloseOnOverlayClick={false}
      ariaHideApp={false}
      className={cn("reactModal")}
      preventScroll={true}
      tabIndex={1}

I do that. But msg said "The call does not have a matching overload" HELP~

0

There are 0 best solutions below