MCPcopy Create free account
hub / github.com/caseywebdev/react-list / updateOptions

Function updateOptions

docs/index.js:4657–4680  ·  view source on GitHub ↗
(node, multiple, propValue, setDefaultSelected)

Source from the content-addressed store, hash-verified

4655 (node.defaultValue = "" + value);
4656}
4657function updateOptions(node, multiple, propValue, setDefaultSelected) {
4658 node = node.options;
4659 if (multiple) {
4660 multiple = {};
4661 for (var i = 0; i < propValue.length; i++)
4662 multiple["$" + propValue[i]] = !0;
4663 for (propValue = 0; propValue < node.length; propValue++)
4664 (i = multiple.hasOwnProperty("$" + node[propValue].value)),
4665 node[propValue].selected !== i && (node[propValue].selected = i),
4666 i && setDefaultSelected && (node[propValue].defaultSelected = !0);
4667 } else {
4668 propValue = "" + getToStringValue(propValue);
4669 multiple = null;
4670 for (i = 0; i < node.length; i++) {
4671 if (node[i].value === propValue) {
4672 node[i].selected = !0;
4673 setDefaultSelected && (node[i].defaultSelected = !0);
4674 return;
4675 }
4676 null !== multiple || node[i].disabled || (multiple = node[i]);
4677 }
4678 null !== multiple && (multiple.selected = !0);
4679 }
4680}
4681function updateTextarea(element, value, defaultValue) {
4682 if (
4683 null != value &&

Callers 3

restoreStateOfTargetFunction · 0.85
setInitialPropertiesFunction · 0.85
updatePropertiesFunction · 0.85

Calls 1

getToStringValueFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…