• <bdo id='eL9aA'></bdo><ul id='eL9aA'></ul>
  • <small id='eL9aA'></small><noframes id='eL9aA'>

    <legend id='eL9aA'><style id='eL9aA'><dir id='eL9aA'><q id='eL9aA'></q></dir></style></legend>

    <i id='eL9aA'><tr id='eL9aA'><dt id='eL9aA'><q id='eL9aA'><span id='eL9aA'><b id='eL9aA'><form id='eL9aA'><ins id='eL9aA'></ins><ul id='eL9aA'></ul><sub id='eL9aA'></sub></form><legend id='eL9aA'></legend><bdo id='eL9aA'><pre id='eL9aA'><center id='eL9aA'></center></pre></bdo></b><th id='eL9aA'></th></span></q></dt></tr></i><div id='eL9aA'><tfoot id='eL9aA'></tfoot><dl id='eL9aA'><fieldset id='eL9aA'></fieldset></dl></div>

      1. <tfoot id='eL9aA'></tfoot>

        如何处理“外"点击 Dialog (Modal) with material-ui

        时间:2023-06-21

          1. <tfoot id='4aJ0C'></tfoot>
            • <bdo id='4aJ0C'></bdo><ul id='4aJ0C'></ul>

                <small id='4aJ0C'></small><noframes id='4aJ0C'>

                • <i id='4aJ0C'><tr id='4aJ0C'><dt id='4aJ0C'><q id='4aJ0C'><span id='4aJ0C'><b id='4aJ0C'><form id='4aJ0C'><ins id='4aJ0C'></ins><ul id='4aJ0C'></ul><sub id='4aJ0C'></sub></form><legend id='4aJ0C'></legend><bdo id='4aJ0C'><pre id='4aJ0C'><center id='4aJ0C'></center></pre></bdo></b><th id='4aJ0C'></th></span></q></dt></tr></i><div id='4aJ0C'><tfoot id='4aJ0C'></tfoot><dl id='4aJ0C'><fieldset id='4aJ0C'></fieldset></dl></div>
                  <legend id='4aJ0C'><style id='4aJ0C'><dir id='4aJ0C'><q id='4aJ0C'></q></dir></style></legend>
                    <tbody id='4aJ0C'></tbody>
                  本文介绍了如何处理“外"点击 Dialog (Modal) with material-ui的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  在框外单击时我的框关闭,使我丢失所有输入.我希望我的盒子只有在点击取消按钮时才关闭.我不确定是什么使它在外面点击时关闭.有什么帮助吗?

                  My box closes when clicking outside of the box making me lose all the input. I want my box to close only when clicking on the cancel button. I am not sure what is making it close when clicking outside. Any help?

                  我正在使用@material-ui/core

                  I am using @material-ui/core

                    _close() {
                          DeviceCreationActions.close();
                      }
                  
                  render() {
                          const actions = [
                              <Button
                                  id="device-create-dialog-close"
                                  key="device-create-dialog-close"
                                  onClick={this._close}
                              >
                                {this.context.intl.formatMessage({id: 'Cancel'})}
                              </Button>
                          ];
                  
                          if (0 < this.state.stepIndex) {
                              actions.push(<Button
                                  id="device-create-dialog-back"
                                  key="device-create-dialog-back"
                                  onClick={this._previousStep.bind(this)}
                                >
                                  {this.context.intl.formatMessage({id: 'Back'})}
                                </Button>
                              );
                          }
                  
                          if (
                              (1 >= this.state.stepIndex && 0 < this.state['formStep' + this.state.stepIndex].length) ||
                              (0 < this.state.stepIndex)
                          ) {
                              actions.push(<Button
                                  id="device-create-dialog-next"
                                  key="device-create-dialog-next"
                                  onClick={2 === this.state.stepIndex ? this._save.bind(this) : this._nextStep.bind(this)}
                                >
                                  {this.context.intl.formatMessage({id: 2 === this.state.stepIndex ? 'Create' : 'Next'})}
                                </Button>
                              );
                          }
                  

                  推荐答案

                  我想你需要的是 disableBackdropClick 传递给 组件

                  I think what you need is disableBackdropClick passed down to <Modal /> component

                  <Modal disableBackdropClick />
                  

                  您还可以使用 disableEscapeKeyDown prop

                  You can also disable close Dialog on Esc key press with disableEscapeKeyDown prop

                  这篇关于如何处理“外"点击 Dialog (Modal) with material-ui的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                • <i id='CbDJg'><tr id='CbDJg'><dt id='CbDJg'><q id='CbDJg'><span id='CbDJg'><b id='CbDJg'><form id='CbDJg'><ins id='CbDJg'></ins><ul id='CbDJg'></ul><sub id='CbDJg'></sub></form><legend id='CbDJg'></legend><bdo id='CbDJg'><pre id='CbDJg'><center id='CbDJg'></center></pre></bdo></b><th id='CbDJg'></th></span></q></dt></tr></i><div id='CbDJg'><tfoot id='CbDJg'></tfoot><dl id='CbDJg'><fieldset id='CbDJg'></fieldset></dl></div>
                  • <bdo id='CbDJg'></bdo><ul id='CbDJg'></ul>

                      <tbody id='CbDJg'></tbody>
                  • <tfoot id='CbDJg'></tfoot>

                        <small id='CbDJg'></small><noframes id='CbDJg'>

                        <legend id='CbDJg'><style id='CbDJg'><dir id='CbDJg'><q id='CbDJg'></q></dir></style></legend>