[QUESTION]: lazyload-wrapper class
See original GitHub issueHi @ameerthehacker, in the latest commit, you merged a pull request that added this span with the className lazyload-wrapper
.
Is there a reason for this?
The previous behavior when the children was visible, was not to have any placeholder or wrapper around them.
Now because of this commit, it breaks my layout because of the extra span
element with that class.
Is this the intended behavior?
Previous code:
return this.visible ? this.props.children : this.props.placeholder ? this.props.placeholder : _react2.default.createElement('div', { style: { height: this.props.height }, className: 'lazyload-placeholder' });
Now:
return _react2.default.createElement(
'span',
{ className: 'lazyload-wrapper', ref: this.setRef },
this.visible ? this.props.children : this.props.placeholder ? this.props.placeholder : _react2.default.createElement('div', {
style: { height: this.props.height },
className: 'lazyload-placeholder'
})
);
Please let me know, thanks!
Issue Analytics
- State:
- Created 3 years ago
- Reactions:6
- Comments:33
Top Results From Across the Web
Developers - [QUESTION]: lazyload-wrapper class - - Bountysource
Hi @ameerthehacker, in the latest commit, you merged a pull request that added this span with the className lazyload-wrapper . Is there a...
Read more >How to lazy load a wrapper div containing a carousel with ...
I found a plugin called jquery-lazyloadanything but I can't figure out how to use it. http://jsfiddle.net/8bJUc/667/ <div class="lazy_wrap"> ...
Read more >Using Lazy and abstract wrapper class to lazy-load complex ...
As a first step I will define base class for all lazy-loaded parameters. This class is wrapper around Lazy<T> and it also offers...
Read more >Lazy Loading Design Pattern - GeeksforGeeks
Lazy loading is just a fancy name given to the process of initializing a class when it's actually needed. In simple words, Lazy...
Read more >react-lazyload - npm
Installation · Now we have an extra div wrapping the lazy loaded component for the React ref to work · We can understand...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Could you consider also at least changing the tag from a span to a div?
Span tags are inline-level elements and should only contain “phrasing content”. If they are used to wrap block-level elements such as div tags then the HTML structure is invalid. In many usage cases users will end up wrapping block-level content which will result in an invalid HTML structure.
https://html.spec.whatwg.org/#the-span-element https://developer.mozilla.org/en-US/docs/Web/HTML/Element/span https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content
https://developer.mozilla.org/en-US/docs/Web/HTML/Inline_elements “Content model Generally, inline elements may contain only data and other inline elements. You can’t put block elements inside inline elements.”
https://en.wikipedia.org/wiki/Span_and_div “For example, regardless of CSS, a span element may not contain block-level children”
@simplecommerce @gilbarbara I have reverted back the old change as 2.6.9 and have released the breaking change as 3.0.0 to npm, @kbradley I have switched span tag with div. @Slapbox currently I’m not sure how to avoid the extra DOM node overhead but will keep thinking on it and meantime if you find any way to improve it feel free to raise a PR.