-
-
Notifications
You must be signed in to change notification settings - Fork 833
Fix scroll offset popping around during image load by putting explicit height back on images #248
Conversation
@richvdh ptal |
onResize: function() { | ||
this.props.onResize(); | ||
this.checkScroll(); | ||
this.refs.geminiPanel.forceUpdate(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This really shouldn't be necessary. Let me have a look at what's going on here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's going on here is I'm an idiot.
* use string refs instead of callback funcs * Add a null-guard in case we don't have an image
richvdh: i'm dubious about switching the closure refs to the null-guarded string refs in the popping fix - surely if the ref fails because the image doesn't exist on the initial pass, we'll still get the popping because the initial layout won't have a pinned image height? |
The ref should not be null in componentdidmount. On 24 March 2016 18:22:23 GMT+00:00, Matthew Hodgson [email protected] wrote:
|
ah ha! i see what was happening - because i was firing fixupHeight from componentDidUpdate it was firing seemingly before componentDidMount(?!), hence null ref. Have added warning logging to catch if the ref is ever null, removed some extraneous console logging, but i think we're good to go now. I'm going to declare this reviewed somewhere between the vdh/moi joint effort here... |
No description provided.