From 423f2f57bd9def2c03c6a529f7b331f6d53929ec Mon Sep 17 00:00:00 2001 From: catamphetamine Date: Wed, 9 Jan 2019 14:57:30 +0300 Subject: [PATCH] #226 onChange(event) fix --- source/PhoneInput.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source/PhoneInput.js b/source/PhoneInput.js index 8f7f46da..7d71f758 100644 --- a/source/PhoneInput.js +++ b/source/PhoneInput.js @@ -639,6 +639,12 @@ export default class PhoneNumberInput extends PureComponent } = this.props + // If `_input` is an `event` + // then extract `event.target.value`. + if (_input && typeof _input.preventDefault === 'function') { + _input = _input.target.value + } + const { input,