Y.WidgetModality causes page jumps #1636
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
It seems that when you create a new Panel which is:
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.
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