MCPcopy Create free account
hub / github.com/Lobos/react-ui / handleChange

Function handleChange

src/Select.js:174–196  ·  view source on GitHub ↗
(i)

Source from the content-addressed store, hash-verified

172 }
173
174 handleChange (i) {
175 if (this.props.readOnly) {
176 return;
177 }
178
179 let data = this.state.data;
180 if (this.props.mult) {
181 data[i].$checked = !data[i].$checked;
182 } else {
183 data.map((d, index) => {
184 if (typeof d !== 'string') {
185 d.$checked = index === i ? true : false;
186 }
187 });
188 this.hideOptions();
189 }
190
191 let value = this.getValue(this.props.sep, data);
192 this.setState({ value, data });
193 if (this.props.onChange) {
194 this.props.onChange(value);
195 }
196 }
197
198 handleRemove (i) {
199 // wait checkClickAway completed

Callers

nothing calls this directly

Calls 2

onChangeMethod · 0.80
getValueMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…