The strict equality check just below the lines added in this commit will fail
if the Item's highlightColor is null/undefined, and if the incoming parameter
is null. This situation happens when
mw.rcfilters.dm.ItemModel.prototype.clearHighlightColor is called when updating
the state from the query parameters. By returning early we can avoid emitting
update events for every filter item.
Bug: T198359
Change-Id: Ia3e5f333964545c7f33777be915389728c03eace
if ( !this.isHighlightSupported() ) {
return;
}
+ // If the highlight color on the item and in the parameter is null/undefined, return early.
+ if ( !this.highlightColor && !highlightColor ) {
+ return;
+ }
if ( this.highlightColor !== highlightColor ) {
this.highlightColor = highlightColor;