Skip to content
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

Change events fire twice on IE8 #1484

Closed
Supersausagedog opened this issue Aug 25, 2016 · 1 comment
Closed

Change events fire twice on IE8 #1484

Supersausagedog opened this issue Aug 25, 2016 · 1 comment

Comments

@Supersausagedog
Copy link

Whenever I use bootstrap selects on IE8 the select event is fired twice, causing the listener to run twice. This caused considerable slowdown.

I wrote a quick fix to the problem, but since I know nothing about the codebase I'm not sure if its a paticularly robust solution.

Original code:

        if (el.fireEvent) {  
            event = document.createEventObject();  
            event.eventType = eventName;  
            el.fireEvent('on' + eventName, event);  
        }  
        this.trigger(eventName);  

IE 8 compatible code:

        if (el.fireEvent) {
            event = document.createEventObject();
            event.eventType = eventName;
            el.fireEvent('on' + eventName, event);
        } else {
            this.trigger(eventName);
        }
@caseyjhol
Copy link
Member

Good catch - thanks. Will get this added.

avantika-gupta-jtg pushed a commit to JoshLabs/bootstrap-select that referenced this issue May 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants