I have created a layout that looks like this:
<ul id="playlists" class="ui-sortable">
<li data-id="b69c8348-f47c-4156-a975-a2f1009610a8" data-type="3" class="listItem playlist active"><i class="fa fa-list fa-fw"></i>
<span class="title" title="">
Playlist 0000
</span>
<input type="text" value="Playlist 0000" class="editableTitle hidden" maxlength="255" />
<span class="count">0</span>
</li>
</ul>
$('.title').click(function(){
$('.title').hide();
$('.hidden').show();
});
$('.hidden').blur(function(){
$('.title').show();
$('.hidden').hide();
});
For a demonstration of the issue I'm facing, check out this JS Fiddle link (tested in latest version of Chrome):
Whenever I toggle the visibility of the hidden input, the font-awesome icon moves up and down. I have tried using vertical-align tricks to align it, but it becomes misaligned when the input is hidden again. Is there a straightforward CSS solution to handle both scenarios?