yui/yui3 — pull request #1636 by andrewnicols (2014-02-13 02:44:29+00:00)
Title: Y.WidgetModality causes page jumps

It seems that when you create a new Panel which is:

* modal; and
* rendered

then the window position jumps to the top of the document.

The default setting for visible is true.
Specifying a visible value of false, and calling show() separately after the dialogue has rendered works around this issue.

This seems to stem from this line of [Widget Modality](https://github.com/yui/yui3/blob/master/src/widget-modality/js/Widget-Modality.js#L335).

As I understand it, the visible parameter is defaulted to true but the widget isn't yet actually visible. As a result, when the focus call is made, and the dialogue isn't yet visible, the browser jumps to the top of the document

I think that this stems from how, while there is a difference between the 'render' and 'rendered' attributes, there is no comparison for 'visible'.

'visible' sometimes records the desired state, and at other times it records the current state.

Example of breakage at http://sandpit.andrewrn.co.uk/yui-broken-panel.html