Skip to content

Destroy Method should not remove select input listeners... #2461

@kaipiyann

Description

@kaipiyann

Hi,

I found an issue with the Prototype version of Chosen. When you destroy a chosen instance the destroy method call on Line 711:

this.form_field.stopObserving();

But this method removes all the listener of the form_field...It would be a lot better to just remove the chosen listener like this :

this.form_field.stopObserving("chosen:updated");
this.form_field.stopObserving("chosen:activate");
this.form_field.stopObserving("chosen:open");
this.form_field.stopObserving("chosen:close");

Because in my case I wanted to destroy then rebuild a chosen select because the select was not visible and the chosen one take a 0 width...but when doing so I lost the original listeners of my select field.

Thks

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