MCPcopy Index your code
hub / github.com/react-dates/react-dates / onChange

Method onChange

src/components/DateInput.jsx:121–133  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

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();

Calls 2

onKeyDownQuestionMarkFunction · 0.70
onChangeFunction · 0.70

Tested by

no test coverage detected