avoid reading innerText (#21217)

this resolves https://github.com/ant-design/ant-design/issues/21160
This commit is contained in:
Rick Zhou 2020-02-04 01:10:28 -08:00 committed by GitHub
parent 7d47413afa
commit 4fa525b8a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -185,7 +185,7 @@ class Button extends React.Component<ButtonProps, ButtonState> {
if (!this.buttonNode || autoInsertSpaceInButton === false) {
return;
}
const buttonText = this.buttonNode.textContent || this.buttonNode.innerText;
const buttonText = this.buttonNode.textContent;
if (this.isNeedInserted() && isTwoCNChar(buttonText)) {
if (!this.state.hasTwoCNChar) {
this.setState({