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

[Enhancement] Add SelectionMode property to ListView #1801

Closed
andreinitescu opened this Issue Feb 6, 2018 · 13 comments

Comments

Projects
9 participants
@andreinitescu
Copy link
Contributor

andreinitescu commented Feb 6, 2018

Rationale

Allow customization of the ListView selection mode.

Implementation

Add a new bindable property called SelectionMode:

public class ListView : ...
{
     public ListViewSelectionMode SelectionMode { get; set; }
}
public enum ListViewSelectionMode
{
     None,
     Single
}

The default value of SelectionMode property will be Single to reflect today's selection mode which is single selection.

None will stop the highlight from appearing when a row is tapped.

When SelectionMode property is set to None, tapping/clicking on items in the ListView will no longer select them; the ItemSelected event will not fire, and the value of the SelectedItem property will remain null.

If the SelectedItem property is set when SelectionMode transitions to None, SeletedItem will be set to null and the ItemSelected event will not fire.

When SelectionMode is None, the ItemTapped event will still fire.

Backward Compatibility

It will work 100% on all platforms.

Difficulty: Easy

Android: set listView.ChoiceMode property to ChoiceMode.None or ChoiceMode.Single
iOS: set tableView.AllowsSelection property to false or true
UWP: set listView.SelectionMode property to ListViewSelectionMode.None or ListViewSelectionMode.Single

@pauldipietro pauldipietro added this to New in Triage Feb 6, 2018

@andreinitescu andreinitescu changed the title [Enhancement] ListView SelectionMode [Enhancement] Add SelectionMode property to ListView Feb 6, 2018

@sander1095

This comment has been minimized.

Copy link

sander1095 commented Feb 6, 2018

You could improve this idea by allowing the user to select multiple items but I don't know how difficult that would be to implement

@jassmith jassmith removed this from New in Triage Feb 8, 2018

@samhouts samhouts added this to Backlog in Enhancements Feb 12, 2018

@andreinitescu

This comment has been minimized.

Copy link
Contributor

andreinitescu commented Feb 13, 2018

@sander1095 Let's not get ahead of ourselves :) You're right, but let's do this in phases maybe, or it will never be done.

@sander1095

This comment has been minimized.

Copy link

sander1095 commented Feb 13, 2018

Sounds good! :D

@hartez

This comment has been minimized.

Copy link
Member

hartez commented Feb 16, 2018

This needs more detail about what happens when SelectionMode is set to None. I'd propose the following:

When this property is set to None, tapping/clicking on items in the ListView will no longer select them; the ItemSelected event will not fire, and the value of the SelectedItem property will remain null.

If the SelectedItem property is set when SelectionMode transitions to None, SeletedItem will be set to null and the ItemSelected event will not fire.

When SelectionMode is None, the ItemTapped event will still fire.

@andreinitescu

This comment has been minimized.

Copy link
Contributor

andreinitescu commented Feb 17, 2018

@hartez I edited the description. Do we have a 100% green light on this? @jassmith ?

@jassmith

This comment has been minimized.

Copy link
Contributor

jassmith commented Feb 17, 2018

Nope, anything in backlog does not have greenlight. This one isn't on the F100 list either so its unlikely to be bumped out of backlog very quickly as we go through the ones that are marked F100. I will send the issue up the flagpole however and see what shimmies back on down.

@andreinitescu

This comment has been minimized.

Copy link
Contributor

andreinitescu commented Feb 17, 2018

@jassmith I don't understand your last sentence.
As someone who wants to become a contributor, it's not clear to me the flow from from a proposed enhancement ticket to one which has been greenlight'ed and it's ready for someone to pickup and be implemented.
Looking at https://github.com/xamarin/Xamarin.Forms/blob/master/CONTRIBUTING.md it talks about "Accepted". But I can't see any "Accepted" tag or project https://github.com/xamarin/Xamarin.Forms/projects

@jassmith

This comment has been minimized.

Copy link
Contributor

jassmith commented Feb 17, 2018

I don't understand your last sentence.

I mean I will raise the enhancement with the PM team to see what they think.

The Contributing.md is WAY out of date. It needs to be updated. Sorry. Use this board: https://github.com/xamarin/Xamarin.Forms/projects/5

Pick anything in the ready for implementation column

@davidortinau davidortinau added the F100 label Mar 9, 2018

@davidortinau

This comment has been minimized.

Copy link
Contributor

davidortinau commented Mar 9, 2018

@andreinitescu I discussed this briefly with @jassmith and would like this to happen. I've added it to F100 and will move it to Ready to Implement. Are you up for doing the work?

@davidortinau davidortinau moved this from Backlog to Ready for Implementation in Enhancements Mar 9, 2018

@jfversluis

This comment has been minimized.

Copy link
Contributor

jfversluis commented Mar 12, 2018

If not I could have a go at it

@ntherning

This comment has been minimized.

Copy link
Member

ntherning commented Mar 14, 2018

I'm going to claim this one as no one seems to be actively working on it.

@ntherning ntherning self-assigned this Mar 14, 2018

@ntherning ntherning moved this from Ready for Implementation to In Progress in Enhancements Mar 14, 2018

ntherning added a commit to ntherning/Xamarin.Forms that referenced this issue Mar 20, 2018

Added the ListView.SelectionMode property
Allows the customization of a ListView's selection mode. Either
ListViewSelectionMode.Single (the default) or ListViewSelectionMode.None can
be set.

Fixes xamarin#1801.

ntherning added a commit to ntherning/Xamarin.Forms that referenced this issue Mar 20, 2018

Added the ListView.SelectionMode property
Allows the customization of a ListView's selection mode. Either
ListViewSelectionMode.Single (the default) or ListViewSelectionMode.None can
be set.

Fixes xamarin#1801.

ntherning added a commit to ntherning/Xamarin.Forms that referenced this issue Mar 20, 2018

Added the ListView.SelectionMode property
Allows the customization of a ListView's selection mode. Either
ListViewSelectionMode.Single (the default) or ListViewSelectionMode.None can
be set.

Fixes xamarin#1801.

@ntherning ntherning referenced this issue Mar 20, 2018

Merged

Added the ListView.SelectionMode property #2143

4 of 4 tasks complete
@rookiejava

This comment has been minimized.

Copy link
Collaborator

rookiejava commented Mar 20, 2018

Tizen : set genlist.SelectionMode property to GenlistSelectionMode.None or GenlistSelectionMode.Always

ntherning added a commit to ntherning/Xamarin.Forms that referenced this issue Mar 27, 2018

Added the ListView.SelectionMode property
Allows the customization of a ListView's selection mode. Either
ListViewSelectionMode.Single (the default) or ListViewSelectionMode.None can
be set.

Fixes xamarin#1801.

Enhancements automation moved this from In Progress to Done Mar 27, 2018

@ManniAT

This comment has been minimized.

Copy link

ManniAT commented Sep 7, 2018

SelectionMode=None (tested in UWP and Android) still shows the "select effect" (Tap animation)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment