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

select box will flicker in IE #273

Merged
merged 3 commits into from Feb 26, 2012

Conversation

Projects
None yet
4 participants
Owner

mbest commented Feb 22, 2012

Another use reported this problem in the forum and I believe it's due to the change I submitted in issue #215. Since this change was to fix a problem only in Chrome, it could be changed to only be run for Chrome. Alternately since the change seems to only cause a problem in IE, it could be not run for IE.

OzWiking commented Feb 3, 2012

Is this problem likely to be fixed?

I would really like to start using v2.0.0 bu this problem is a show stopper for me.

Owner

mbest commented Feb 22, 2012

@OzWiking contributed code to reproduce this: http://jsfiddle.net/OzWiking/5RBdR/4/

Contributor

SteveSanderson commented Feb 24, 2012

Great news - turns out this issue no longer exists anyway, so we can remove both the Chrome workaround (which was actually needed for Safari too), and the IE-workaround-for-the-workaround.

The issue no longer exists for two reasons:

  1. The original Chrome rendering bug is fixed in Chrome v17 anyway, even for people running KO 1.3rc. That's not quite good enough, though, because the rendering bug is still present in the latest version of Safari.
  2. The fact that KO-latest uses ko.utils.setTextContent to write text to the options happens to have the happy side-effect of eliminating the problem anyway, for current versions of Chrome and Safari (perhaps older ones too, haven't checked).

I'll add a further commit that removes both fixes to keep the KO codebase tidy.

Steve, let's change this back to just element.scrollTop = previousScrollTop; IE8 otherwise changes the scrollTop if you select the second item.

Owner

mbest commented Feb 24, 2012

Great catch. Certainly good to get rid of browser hacks like that.

Contributor

SteveSanderson commented Feb 24, 2012

IE8 otherwise changes the scrollTop if you select the second item.

Is that just a native browser behavior, though? i.e., does IE8 scroll select boxes like that normally, even without KO? We probably don't want to interfere with the native select box handling except if it's definitely a bug.

Owner

mbest commented Feb 24, 2012

I didn't figure out exactly what causes the problem in IE8, but it definitely doesn't happen with a just a normal select box. In any case, there seems to be no need to keep if (previousScrollTop)

Fix related bug that affects IE8 (maybe other versions):
Selecting second item in a size>1 select will move scroll down one item.

SteveSanderson added a commit that referenced this pull request Feb 26, 2012

@SteveSanderson SteveSanderson merged commit 72ed31e into master Feb 26, 2012

you can use: !!window.chrome

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