That's certainly useful, but not nearly as much magic as it seems :D
One thought I'd like to add is that this CSS-solution has a few interesting implications.
Say, for example, you wanted the last task in the list to have some special styling. Assuming your tasks are rendered as <div class="task> here goes content </div>, you might write some CSS that looks like this:
.task:last-child{color:red;}
But having that hidden block at the end will mess with this selector. This is yet another reason why :nthlast-child(1 of .task) would be a very helpful addition to CSS.
Another implication is that adding or removing tasks through JavaScript without re-rendering would still eventually show and hide the placeholder, whereas otherwise the JS code would have to take care of adding and removing the element, either by adding it as a template from ruby, or by duplicating the HTML in the JS code.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
sooo... it basically does something along the lines of
That's certainly useful, but not nearly as much magic as it seems :D
One thought I'd like to add is that this CSS-solution has a few interesting implications.
Say, for example, you wanted the last task in the list to have some special styling. Assuming your tasks are rendered as
<div class="task> here goes content </div>
, you might write some CSS that looks like this:But having that hidden block at the end will mess with this selector. This is yet another reason why
:nthlast-child(1 of .task)
would be a very helpful addition to CSS.Another implication is that adding or removing tasks through JavaScript without re-rendering would still eventually show and hide the placeholder, whereas otherwise the JS code would have to take care of adding and removing the element, either by adding it as a template from ruby, or by duplicating the HTML in the JS code.