Problem using UI Dialog with IE8

Problem using UI Dialog with IE8

I having a problem with jQueryUI dialog on IE8. What I'm finding is that scroll bars are added to the window because the overlay is too big. In addition this causes continuous resize events.

The overlay size problem is because dialog calls $(document).width()/.height() to setup the size of the overlay but on IE8 the size is larger than is should be. In jquery width/height on the document returns the max of a number of things including documentElement clientWidth, scrollWidth and offsetWidth. For some reason offsetWidth is larger than the others on IE8 only. Could this be due to the markup of my page? I'll look into that some more but my page is (I think) simple. It manages the size and layout of divs so that the window is always filled and without scroll bars.

The continuous resize event problem is because of the overlay resize code where it first shrinks the overlay to 0 and then makes it as big as the screen (again getting it wrong). I don't see why this should cause a resize since the window doesn't actually change size. Ticket 4097 says that IE8 used to have a problem with reflow causing a resize. But it says that was fixed. Is this somehow related? Perhaps if the overlay size is calculated right then the scroll bars and resize event problems will go away.

Any one else seen this or have a workaround? I may attempt changing the overlay size code to use documentElement clientWidth which I know works for the browsers I'm supporting.

jQueryUI version 1.7.2 and jQuery version 1.3.2