(e)
| 119 | } |
| 120 | |
| 121 | onChange(e) { |
| 122 | const { onChange, onKeyDownQuestionMark } = this.props; |
| 123 | const dateString = e.target.value; |
| 124 | |
| 125 | // In Safari, onKeyDown does not consistently fire ahead of onChange. As a result, we need to |
| 126 | // special case the `?` key so that it always triggers the appropriate callback, instead of |
| 127 | // modifying the input value |
| 128 | if (dateString[dateString.length - 1] === '?') { |
| 129 | onKeyDownQuestionMark(e); |
| 130 | } else { |
| 131 | this.setState({ dateString }, () => onChange(dateString)); |
| 132 | } |
| 133 | } |
| 134 | |
| 135 | onKeyDown(e) { |
| 136 | e.stopPropagation(); |
no test coverage detected