Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

SelectMenu stops working in IE8 when DOM changes #298

Closed
chernobil opened this Issue Apr 17, 2013 · 3 comments

Comments

Projects
None yet
2 participants

Hi
the issue is only in IE7 and IE8 - the select menu stops showing when there is some DOM changing event (hide/show element for example) at the time when the selectmenu has to be opened. One of the reasons for the issue is that these browsers trigger window.resize not only when the actual window is resized but even when you show/hide element (and many other cases) .
Here is an example http://jsfiddle.net/EUNBj/2/ (btw jsfiddle doesn't work in Browser Mode IE8 of the IE) so you won't be able to see the problem with modern browser, but it's good ilustration .
To reproduce the issue in the example :

  1. type something in the input
  2. click the select menu bellow

I'm using jQuery UI Selectmenu version 1.3.0. And have developed the following "fix" on line 267 : $( window ).bind( "resize.selectmenu-" + this.ids[ 0 ], $.proxy( self.close, this ) );
changed to

var lastHeight = $(window).height();
var lastWidth = $(window).width();

        // needed when window is resized
        $(window).bind("resize.selectmenu-" + this.ids[0], $.proxy(
            function (e) {
                if ($(window).height() != lastHeight || $(window).width() != lastWidth ) {

                    //set this windows size
                    lastHeight = $(window).height();
                    lastWidth = $(window).width();

                    self.close(e);
                }
            }, this));

This solved it. The idea is not to close the select menu on window resize unless it's an actual resize

Owner

fnagel commented Sep 7, 2013

Would you mind to test if this issue is still a problem in latest version?

Owner

fnagel commented Nov 7, 2013

Any feedback on this issue?

Owner

fnagel commented Feb 18, 2014

Closed as no feedback was given. Please re-open if needed.

@fnagel fnagel closed this Feb 18, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment