opitzconsulting / jquery-mobile-angular-adapter

jquery mobile angular adapter
MIT License
517 stars 114 forks source link

Toggling visibility of listview with data-filter=true #124

Closed marcorinck closed 11 years ago

marcorinck commented 11 years ago

Hi,

when toggling visibility of listviews which have "data-filter=true" the listview is toggled but the filter bar stays.

see this fiddle: http://jsfiddle.net/marcorinck/hKbsJ/1/

This happens when using ng-show and ngm-if.

When using ngm-if, for every new rendering when list is visible again, jqm creates another new filter bar so that you end up with many many many filter bars when toggling ... , see this fiddle: http://jsfiddle.net/marcorinck/hKbsJ/2/

Marco

tbosch commented 11 years ago

Hi, the listview creates a sibling form element for the filter bar directly in front of it. As there is no common parent element for the listview and the filter bar, ng-show can only hide the list but not also the search bar.

A workaround would be to put the listview into a wrapper div and add the ng-show to that div, e.g.

     <div ngm-if="showItems">
         <ul data-role="listview" data-filter="true">
             <li>1</li>
         </ul>
     </div>

Closing this, as there is no possibility for the adapter to resolve this... Tobias