Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why binding mask handlers on wrap element instand of mask element? #178

Open
4074 opened this issue Jan 25, 2020 · 0 comments
Open

Why binding mask handlers on wrap element instand of mask element? #178

4074 opened this issue Jan 25, 2020 · 0 comments

Comments

@4074
Copy link

4074 commented Jan 25, 2020

While I reading the source code, a question confuses me.
Why binding mask handlers on wrap element instand of mask element?
For example, the onMaskClick and onMaskMouseUp handlers.

    // At the end of Dialog.tsx.
    return (
      <div className={`${prefixCls}-root`}>
        {this.getMaskElement()}
        <div
          tabIndex={-1}
          onKeyDown={this.onKeyDown}
          className={`${prefixCls}-wrap ${props.wrapClassName || ''}`}
          ref={this.saveRef('wrap')}
          onClick={maskClosable ? this.onMaskClick : null}
          onMouseUp={maskClosable ? this.onMaskMouseUp : null}
          role="dialog"
          aria-labelledby={props.title ? this.titleId : null}
          style={style}
          {...props.wrapProps}
        >
          {this.getDialogElement()}
        </div>
      </div>
    );

Very grateful if someone tell me the reason.
And, please forgive my fool question.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant