Bug Fix Recommendation for Older Browser Compatibility

Tagged:
  • pridigital
    Participant
    1 year, 10 months ago #52308

    Hi there,

    I believe I’ve found a bug in the source code that occurs when these lines are executed in older browser versions, particularly in Edge.

    
    $this.prevAll().each(function () {
        if (current_selected_level > $(this).data('wpsolr-facet-data').level) {
            $(this).addClass('checked');
            // Recursive on parents
            current_selected_level = $(this).data('wpsolr-facet-data').level;
        }
    });
    

    I fixed it by replacing it with this code, so you may want to consider applying the same fix in future versions of the plugin.

    
    var _$this$prevAll;
    
    (_$this$prevAll = $this.prevAll()) === null || _$this$prevAll === void 0 ? void 0 : _$this$prevAll.each(function () {
        if (current_selected_level > $this.data('wpsolr-facet-data').level) {
            $this.addClass('checked');
            // Recursive on parents
            current_selected_level = $this.data('wpsolr-facet-data').level;
        }
    });
    

    Best

    pridigital
    Participant
    1 year, 4 months ago #54151

    Any thoughts?

    wpsolr
    Keymaster
    1 year, 4 months ago #54159

    This javascript code is very sensitive and extremely difficult to modify and test.

    This is why we cannot update it.

Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘Bug Fix Recommendation for Older Browser Compatibility’ is closed to new replies.