-
Notifications
You must be signed in to change notification settings - Fork 13.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ion-list: upcoming 1.0.0 syntax #1024
Conversation
What does the final markup look like when everything is used? I do like the idea of Right now Also, when |
One more change I forgot to list: delete buttons and reorder buttons are actually display: none instead of just opacity 0 while not used now, which will definitely increase scrolling perf |
I think this is great @ajoslin. I see very little reason for death threats this time around. ;) Performance increases sound very good. Perhaps some things to consider for a next version are sticky list headers (yup I had to mention them) and perhaps even inclusion of bindonce if dirty checking isn't needed. But I heard you were also thinking of implementing virtual scroll in the next big release so that might cover the reason for using bindonce in the first place. |
Also: how can we set if an item is a divider? |
|
Looking forward to it! |
Will this work if you use ui-routers And +1 for sticky item headers |
Yes, normal click events on a div will work for everything except hrefs. |
I have an old branch with a version of sticky headers kind of implemented (needs polish). Maybe we could have two options for that: Or on item: CatsWe can move that to a different discussion issue just got all excited :) Sent from my iPhone
|
@mlynch We could also consider having a generic 'sticky' option to apply to any old element. |
@ajoslin I like that idea better. Though I'm not sure what other situations where a sticky element could be used except lists, it's better to abstract it so it could implemented anywhere |
Also, $ionicListDelegate is coming :-)
Any other useful methods to add? |
|
@ajoslin, maybe there's room for two? For a list, you often generate a group for quick sorting (same goes for that collection view stuff we talked about). The tricky part is you are moving multiple stickies in and out (each group header "pushes" the last one up, for example) A sticky to me is just a way to make position: sticky work with our scroll system, which would be totally awesome but maybe two separate things? |
Good point, you do usually do groups. I'll get this initial version pushed out, let's open a new issue for stickies. #1025 |
@ajoslin Oh, and be sure to test the animations of the delete and reorder icons when they are first animate in. That's they're start out using opacity: 0. |
👍 |
Added a PR. Still TODO:
|
Also need some method to close the swiped list item. That's been requested User swipes to expose buttons. Clicks something. List should On Wed, Apr 2, 2014 at 4:24 PM, Andy Joslin notifications@github.comwrote:
Thanks, |
@calendee |
BREAKING CHANGE: ion-list syntax has changed in favor of simplicity & flexibility. Relevant documentation: [ionList](http://ionicframework.com/docs/api/directive/ionList), [ionItem](http://ionicframework.com/docs/api/directive/ionItem), [ionOptionButton](http://ionicframework.com/docs/api/directive/ionOptionButton), [ionReorderButton](http://ionicframework.com/docs/api/directive/ionReorderButton), [ionDeleteButton](http://ionicframework.com/docs/api/directive/ionDeleteButton), [$ionicListDelegate](http://ionicframework.com/docs/api/service/$ionicListDelegate). To migrate, change your code from this: ```html <ion-list option-buttons="[{text:'hello',type:'button-positive',onTap:tap()}]" on-delete="onDelete(el)" delete-icon="ion-minus-circled" can-delete="true" show-delete="shouldShowDelete" on-reorder="onReorder(el, startIndex, toIndex)" reorder-icon="ion-navicon" can-reorder="true" show-reorder="shouldShowReorder"> <ion-item ng-repeat="item in items"> {{item}} </ion-item> </ion-list> ``` To this: ```html <ion-list show-delete="shouldShowDelete" show-reorder="shouldShowReorder"> <ion-item ng-repeat="item in items"> {{item}} <ion-delete-button class="ion-minus-circled" ng-click="onDelete(item)"> </ion-delete-button> <ion-reorder-button class="ion-navicon" ng-click="onReorder(item, $fromIndex, $toIndex)"> </ion-reorder-button> <ion-option-button class="button-positive" ng-click="tap()"> Hello </ion-option-button> </ion-item> </ion-list> ```
Merged! |
maybe? I want the same behavior of WhatsApp, when you click on Edit and then in the delete button, it shows the option button to actually erase the message. |
I would like to the ability to programmatically open and close list item drawers. For example, Android should be able to listen for a long tap, and invoke the opening of the option buttons for that applicable list item. Thanks for all the rad work! |
List refactor:
Simple case:
Everything case:
Thoughts, questions, concerns, complaints, insults, death threats?
/cc @adamdbradley @mlynch @mhartington @CoenWarmer @rvanbaalen @D3CK3R @calendee and anyone else who has a comment