diff --git a/vendors/knockout/src/binding/defaultBindings/value.js b/vendors/knockout/src/binding/defaultBindings/value.js index 64b23d3d5..af7535d23 100644 --- a/vendors/knockout/src/binding/defaultBindings/value.js +++ b/vendors/knockout/src/binding/defaultBindings/value.js @@ -35,7 +35,7 @@ ko.bindingHandlers['value'] = { // This is useful, for example, to catch "keydown" events after the browser has updated the control // (otherwise, ko.selectExtensions.readValue(this) will receive the control's value *before* the key event) var handler = valueUpdateHandler; - if (ko.utils.stringStartsWith(eventName, "after")) { + if ((eventName||'').startsWith("after")) { handler = () => { // The elementValueBeforeEvent variable is non-null *only* during the brief gap between // a keyX event firing and the valueUpdateHandler running, which is scheduled to happen diff --git a/vendors/knockout/src/utils.js b/vendors/knockout/src/utils.js index 7623819c7..1c9807a4f 100644 --- a/vendors/knockout/src/utils.js +++ b/vendors/knockout/src/utils.js @@ -89,13 +89,6 @@ ko.utils = { string.trim() : string.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g, ''), - stringStartsWith: (string, startsWith) => { - string = string || ""; - if (startsWith.length > string.length) - return false; - return string.substring(0, startsWith.length) === startsWith; - }, - domNodeIsContainedBy: (node, containedByNode) => containedByNode.contains(node.nodeType !== 1 ? node.parentNode : node),