Replace ko.utils.stringStartsWith with native String.startsWith

This commit is contained in:
djmaze 2021-09-28 13:20:54 +02:00
parent 2d4ce14b1c
commit 7d97ae3145
2 changed files with 1 additions and 8 deletions

View file

@ -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