-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Marker changes did not trigger change:data
#11506
Conversation
…event which resulted in errors in features using markers (for example, annotations not showing up in the sidebar).
if ( this._changesInElement.size > 0 ) { | ||
return true; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was moved to the beginning but it makes sense, if there are any "regular" changes in the differ, return true
.
for ( const { newMarkerData, oldMarkerData } of this._changedMarkers.values() ) { | ||
if ( newMarkerData.affectsData !== oldMarkerData.affectsData ) { | ||
return true; | ||
} | ||
|
||
if ( newMarkerData.affectsData ) { | ||
// Skip markers, which ranges have not changed. | ||
if ( newMarkerData.range && oldMarkerData.range && newMarkerData.range.isEqual( oldMarkerData.range ) ) { | ||
return false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was incorrect early false
, it should have been continue
or changed as I did.
it( 'should return `true` if at least one marker changed', () => { | ||
differ.bufferMarkerChange( 'nameA', { range, affectsData: true }, { range, affectsData: true } ); | ||
differ.bufferMarkerChange( 'nameB', { range, affectsData: true }, { range: rangeB, affectsData: true } ); | ||
differ.bufferMarkerChange( 'nameC', { range, affectsData: true }, { range, affectsData: true } ); | ||
|
||
expect( differ.hasDataChanges() ).to.be.true; | ||
} ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a new test, all the other are re-arranged or modified.
Oh, that's my fault 🙈 This change looks good to me. |
Suggested merge commit message (convention)
Fix (engine): Marker changes sometimes did not trigger
change:data
event which resulted in errors in features using markers (for example, annotations not showing up in the sidebar).