Skip to content

Empty Style Tags, Long Property and Class Names and IE11 Performance #1797

Open
@jbrianj

Description

@jbrianj

While debugging IE 11 performance Issues in with a large result set from a search I discovered, that line 252 of the chosen.jquery.js file has a check which is failing which is causing empty style tags to be written to each drop down.

style = option.style.cssText !== "" ? " style=\"" + option.style + "\"" : "";

In both IE 11 and Chrome, .cssText is undefined. This bloats the content that is being evaluated by jQuery's rnoInnerHtml regex and causes the slowness in IE 11.

It would also be helpful to reduce the length of your class names and properties to reduce the data size being evaluated.

Locally I renamed:
data-array-option-index = data-index,
active-result = active,
disabled-result = disabled

This seems to resolve the performance issue in my local testing.

I might be out of line, but might I suggest you remove the active-result class all together?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions