dmachi / dojox_application

Dojox Application Framework for mobile, tablets, and desktops
Other
27 stars 24 forks source link

Lazy-loaded views "flash" into view when initially placed #209

Closed nickcmaynard closed 10 years ago

nickcmaynard commented 10 years ago

Absolutely positioned views (when using CSS layout) are placed in their container with default visibility when initially created.

This creates a problem as there's a short period before the "loading" transition kicks in, and the view is "on top" of the container.

The "new" view should have visibility set to "hidden" as it's initially placed. Once it has been moved off screen, it can then be shown pre-transition.

edchat commented 10 years ago

The suggested flow was: 1) create the view 2) make it invisible (visibility hidden) 3) initLayout 4) if transition, do initial pre-transition placement then cancel invisibility before kicking off transition 5) if no transition, then cancel invisibility

edchat commented 10 years ago

Does the problem only occur when the view is created (the first time the view is shown)? Or should we try to set visibility hidden for the view if it has already been created/loaded once?
The code you tested with only sets the visibility hidden when the view is created the first time. I am thinking it should be setting visibility hidden on the view even if it is already been displayed.

edchat commented 10 years ago

When Gary Yoong tested the fix for this he ran into a problem with some widgets setting visibilty visible while the view was still hidden, so those fields would show up before the rest of the view. The suggested was made to try using opacity 0 instead of visibilty hidden to avoid that problem. We tested with that and it seems to work and solve his problem. Any concerns about using opacity instead of visibility?

cjolif commented 10 years ago

I'm not very keen on using opacity. After all this means at least in theory that the view is still rendered just that is transparent. Not really ideal. Can't we get into the root issue instead and see why the have widgets which are forcing visibility?

edchat commented 10 years ago

Fixed with this pull request: https://github.com/dmachi/dojox_application/pull/210