diff --git a/src/components/IntlTelInput.js b/src/components/IntlTelInput.js index 45a0deea1..2c584f6e9 100644 --- a/src/components/IntlTelInput.js +++ b/src/components/IntlTelInput.js @@ -156,6 +156,10 @@ class IntlTelInput extends Component { ) { this.updatePlaceholder(this.props); } + + if (this.props.allowDropdown !== prevProps.allowDropdown) { + this.allowDropdown = this.props.allowDropdown; + } } componentWillUnmount() { @@ -997,7 +1001,6 @@ class IntlTelInput extends Component { }; generateMarkup = () => { - this.wrapperClass['allow-dropdown'] = this.allowDropdown; this.wrapperClass['separate-dial-code'] = this.props.separateDialCode; if (this.isMobile && this.props.useMobileFullscreenDropdown) { @@ -1249,6 +1252,7 @@ class IntlTelInput extends Component { const inputClass = this.props.inputClassName; const wrapperStyle = Object.assign({}, this.props.style || {}); + this.wrapperClass['allow-dropdown'] = this.allowDropdown; this.wrapperClass.expanded = this.state.showDropdown; const wrapperClass = classNames(this.wrapperClass);