Skip to content

Commit 1bb0a5a

Browse files
committed
Merge pull request #169 from wmde/parsedelay
Fix premature save of parsed values
2 parents c26e42e + b2d07d3 commit 1bb0a5a

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/jquery.valueview.valueview.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -799,13 +799,12 @@ $.widget( 'valueview.valueview', PARENT, {
799799
throw new Error( 'Unexpected value parser result' );
800800
}
801801

802-
if( self.__lastUpdateValue === undefined ) {
802+
if( self.__lastUpdateValue === undefined || self.__lastUpdateValue !== rawValue ) {
803803
// latest update job is done, this one must be a late response for some weird
804-
// reason
804+
// reason, or the value has since been updated, so should be re-parsed
805+
// and this result be rejected and ignored.
805806
deferred.reject();
806-
}
807-
808-
if( self.__lastUpdateValue === rawValue ) {
807+
} else {
809808
// this is the response for the latest update! by setting this to undefined, we
810809
// will ignore all responses which might come back late.
811810
// Another reason for this could be something like "a", "ab", "a", where the

0 commit comments

Comments
 (0)