Blazorise icon indicating copy to clipboard operation
Blazorise copied to clipboard

AutoComplete multiple checkbox

Open David-Moreira opened this issue 3 years ago • 17 comments

Closes #3867 Closes #3401 Closes #3828

David-Moreira avatar Jun 05 '22 23:06 David-Moreira

Closes #3828

David-Moreira avatar Jun 07 '22 16:06 David-Moreira

There are some conflicts so I think you should be the one to fix them. Or I could accidentally break something. Agree?

stsrki avatar Jul 11 '22 12:07 stsrki

There are some conflicts so I think you should be the one to fix them. Or I could accidentally break something. Agree?

Yep

David-Moreira avatar Jul 11 '22 21:07 David-Moreira

SuggestMultipleCheckbox seems strange to me. I think it would be better to have something like enum MultipleSelectionMode with Checkbox, Default, and values. Or just SelectMultipleWithCheckbox.

stsrki avatar Jul 12 '22 09:07 stsrki

SuggestMultipleCheckbox seems strange to me. I think it would be better to have something like enum MultipleSelectionMode with Checkbox, Default, and values. Or just SelectMultipleWithCheckbox.

It's like an enhancement over SuggestSelectedItems : image Hence maintaining same prefix.

The enum MultipleSelectionMode is a good idea, I'd probably prefer to rework some stuff to be:

enum SelectionMode{
Default,
Multiple,
SuggestSelected, (this still bases itself off multiple mode behind the covers)
Checkbox (this still bases itself off multiple + suggestselected mode behind the covers)
}

What do you think? It would be breaking change tough. We could schedule an issue with this, and for now leave it like it is?

David-Moreira avatar Jul 17 '22 10:07 David-Moreira

The enum MultipleSelectionMode is a good idea, I'd probably prefer to rework some stuff to be:

enum SelectionMode{
Default,
Multiple,
SuggestSelected, (this still bases itself off multiple mode behind the covers)
Checkbox (this still bases itself off multiple + suggestselected mode behind the covers)
}

What do you think? It would be breaking change tough. We could schedule an issue with this, and for now, leave it like it is?

Having SuggestSelected in the enum doesn't make sense. It can easily be a boolean because it is not a new mode per-se, just a modification of the existing Multiple selection mode.

Checkbox can be part of the SelectionMode.

stsrki avatar Jul 17 '22 11:07 stsrki

The enum MultipleSelectionMode is a good idea, I'd probably prefer to rework some stuff to be:

enum SelectionMode{
Default,
Multiple,
SuggestSelected, (this still bases itself off multiple mode behind the covers)
Checkbox (this still bases itself off multiple + suggestselected mode behind the covers)
}

What do you think? It would be breaking change tough. We could schedule an issue with this, and for now, leave it like it is?

Having SuggestSelected in the enum doesn't make sense. It can easily be a boolean because it is not a new mode per-se, just a modification of the existing Multiple selection mode.

Checkbox can be part of the SelectionMode.

You could argue the same for Checkbox then... not a new mode per-se... modification/enhancement of the existing....

David-Moreira avatar Jul 17 '22 22:07 David-Moreira

True, but SuggestSelected can change the behavior of both Multiple and Checkbox modes. That's why it is better to make it a separate thing.

stsrki avatar Jul 18 '22 08:07 stsrki

Default, Multiple,

Eitherway it's best to keep it for a future milestone right? Multiple is already implemented as a bool

David-Moreira avatar Jul 18 '22 20:07 David-Moreira

Default, Multiple,

Eitherway it's best to keep it for a future milestone right? Multiple is already implemented as a bool

Do you mean to keep new enum for the future? I would add it now in v1.1, and then mark Multiple as obsolete and to be removed in v2.0.

stsrki avatar Jul 19 '22 09:07 stsrki

Default, Multiple,

Eitherway it's best to keep it for a future milestone right? Multiple is already implemented as a bool

Do you mean to keep new enum for the future? I would add it now in v1.1, and then mark Multiple as obsolete and to be removed in v2.0.

Ok seems good to me then. just have to take note, that currently if AutoComplete is set to Default and Multiple is set to true, it will override it. :)

David-Moreira avatar Jul 19 '22 13:07 David-Moreira

Figure out : image

David-Moreira avatar Jul 23 '22 11:07 David-Moreira

Attempt other proposed enhancements if time available.

There should also be a search bar in the dropdown, before the first Item in the List.

(Investigate this one, might not make sense with our current component)

There should be an Arrow/Chevron on the right side of the mainbar, so its more Intuitive for the User, that you can open a dropdown.

(seems like it wouldn't be too hard and makes sense)

From #3867

David-Moreira avatar Jul 23 '22 15:07 David-Moreira

There should be an Arrow/Chevron on the right side of the mainbar, so its more Intuitive for the User, that you can open a dropdown.

(seems like it wouldn't be too hard and makes sense)

From #3867

Don't underestimate it. Adding any up-down button can be a real pain. I know about it when I did the NumericEdit step buttons. And it's really hard to do it for all providers.

stsrki avatar Jul 23 '22 18:07 stsrki

There should be an Arrow/Chevron on the right side of the mainbar, so its more Intuitive for the User, that you can open a dropdown.

(seems like it wouldn't be too hard and makes sense) From #3867

Don't underestimate it. Adding any up-down button can be a real pain. I know about it when I did the NumericEdit step buttons. And it's really hard to do it for all providers.

hmm then i Might not loose anytime with this at all then haha

David-Moreira avatar Jul 24 '22 09:07 David-Moreira

There should be an Arrow/Chevron on the right side of the mainbar, so its more Intuitive for the User, that you can open a dropdown.

(seems like it wouldn't be too hard and makes sense) From #3867

Don't underestimate it. Adding any up-down button can be a real pain. I know about it when I did the NumericEdit step buttons. And it's really hard to do it for all providers.

hmm then i Might not loose anytime with this at all then haha

Hey Guys, do I get it right and the suggested Checkbox wont be implemented?

Kind regards, Silas

ddsilasb avatar Aug 04 '22 09:08 ddsilasb

There should be an Arrow/Chevron on the right side of the mainbar, so its more Intuitive for the User, that you can open a dropdown.

(seems like it wouldn't be too hard and makes sense) From #3867

Don't underestimate it. Adding any up-down button can be a real pain. I know about it when I did the NumericEdit step buttons. And it's really hard to do it for all providers.

hmm then i Might not loose anytime with this at all then haha

Hey Guys, do I get it right and the suggested Checkbox wont be implemented?

Kind regards, Silas

Checkbox is currently in testing and should be available in v1.1.0 we were wondering if we had time to squeeze more features like the arrow indicator, which we probably won't yet.

David-Moreira avatar Aug 04 '22 17:08 David-Moreira

@glutio Freetype an item, go back to typing a value that results in options, first item is no longer auto pre selected chrome-capture-2022-7-22 .

David-Moreira avatar Aug 22 '22 00:08 David-Moreira

@glutio would you be willing to briefly write up your notable changes on the v1.1 release page? AutoSelectFirstItem && the keyboard interaction. Just let us know if you'd rather that we write them instead.

image

You can add a mention to your github tag as having contributed. :) image

Again, appreciated your hard work on this. :)

David-Moreira avatar Aug 22 '22 00:08 David-Moreira

Note to self Release notes / Docs: Touch upon the new SelectionMode parameter SuggestMultipleCheckbox parameter no longer exists

David-Moreira avatar Aug 22 '22 00:08 David-Moreira

How about we make Autocomplete a separate page in the demo app? Seems like it has grown quite a bit.

stsrki avatar Aug 22 '22 08:08 stsrki

How about we make Autocomplete a separate page in the demo app? Seems like it has grown quite a bit.

Right could probably condense the options into a single autocomplete like we do for Datagrid

David-Moreira avatar Aug 22 '22 12:08 David-Moreira

Sure, will take a look at the auto select and put something into the notes

glutio avatar Aug 22 '22 13:08 glutio

first item is no longer auto pre selected

Cannot repro

https://user-images.githubusercontent.com/22550674/185979878-a4749d3f-628b-42f3-a116-167521e31c48.mp4

glutio avatar Aug 22 '22 17:08 glutio

About release notes, on second thought, I would need to create a separate branch but one of you could probably update the release notes directly in master, so maybe for simplicity I'll leave it to you to update it. I would write something like this, feel free to edit:

  • Improved keyboard support. You can now select items and remove selection using keyboard alone. Use navigation arrows to select an item in the dropdown. In multi-select mode use Backspace to remove most recently selected item or use [Shift-]Tab and Enter key to remove any previously selected item.

  • Introduced AutoSelectFirstItem property for single-select mode. Use this property to automatically select the first item from Data during Autocomplete initialization.

Thanks!

glutio avatar Aug 22 '22 17:08 glutio

first item is no longer auto pre selected

Cannot repro

Blazorise.Autocomplete.component.and.9.more.pages.-.Work.-.Microsoft.Edge.2022-08-22.10-09-15.online-video-cutter.com.mp4

I'm not home yet. But from your video I think you missed the actual commit of the item by pressing enter or leaving the field. At least your video does not look exactly like my gif but I can detail the repro better later today.

David-Moreira avatar Aug 22 '22 17:08 David-Moreira

About release notes, on second thought, I would need to create a separate branch but one of you could probably update the release notes directly in master, so maybe for simplicity I'll leave it to you to update it. I would write something like this, feel free to edit:

  • Improved keyboard support. You can now select items and remove selection using keyboard alone. Use navigation arrows to select an item in the dropdown. In multi-select mode use Backspace to remove most recently selected item or use [Shift-]Tab and Enter key to remove any previously selected item.
  • Introduced AutoSelectFirstItem property for single-select mode. Use this property to automatically select the first item from Data during Autocomplete initialization.

Thanks!

It's available in this branch, there's a docs project with the release notes. But we can go ahead and edit them with the texts you provided thanks.

David-Moreira avatar Aug 22 '22 17:08 David-Moreira

but I can detail the repro better later today

nevermind, i was looking at this branch in my fork, which has old code...

glutio avatar Aug 22 '22 19:08 glutio

i have the fix but i don't have permissions to push to this branch.. attached patch - git apply patch.txt patch.txt

glutio avatar Aug 22 '22 20:08 glutio

AHHH, sorry completly forgot the branch is under the organization, haha, yes you'd need to submit a PR on top of this branch, right.

Ok thanks.

David-Moreira avatar Aug 22 '22 20:08 David-Moreira