UserFrosting icon indicating copy to clipboard operation
UserFrosting copied to clipboard

ufCollection - Selected rows aren't removed from dropdown

Open Silic0nS0ldier opened this issue 7 years ago • 10 comments

Noticed this while porting over to the new template pattern. Initially thought I'd busted something, but further investigation revealed this issue was pre-existing,

In a nut shell, you can endlessly select items, provided the item just clicked on is allowed to leave the 'depressed' button state.

Observed in Edge and Chrome.

image

Silic0nS0ldier avatar May 24 '17 12:05 Silic0nS0ldier

On my install, when editing the role permissions, I can't select the same permission twice in a row. But if I select User, then Group, then I can select user again. Those are not saved twice though. So it's not you or your edits.

At the same time, when the modal is first loaded, it shoudn't display in the collection dropdown the one already in the table.

lcharette avatar May 24 '17 12:05 lcharette

Yeah, I want to add this as an option at some point (actually, I had tried to implement it before but I couldn't get it to work). Basically we need to keep track of the id's of the added items internally, and then pass them to the API endpoint (if used). Probably with some sort of exclude parameter.

alexweissman avatar May 24 '17 14:05 alexweissman

I wouldn't call this a bug, though. In some circumstances, the ability to add an element multiple times, might actually be the desired behavior.

alexweissman avatar May 24 '17 14:05 alexweissman

In the scenario, it is expected that an option that's already been selected would disappear from the dropdown (hence the confirm bug tag). If we want to fix this, and implement a feature in the process, fair enough.

But the fact is, this is a bug. If it were a feature, you'd be able to click on the same dropdown item to endlessly add it, but alas this isn't the case due to it needing to be 'depressed'.

Silic0nS0ldier avatar May 25 '17 09:05 Silic0nS0ldier

Maybe it's a bug in the specific context of the way we're using it for user roles and role permissions?

alexweissman avatar May 25 '17 14:05 alexweissman

To quote myself "...but alas this isn't the case due to it needing to be 'depressed'." Once you've clicked on a dropdown open, you can't click on it again right away. You have to shift the focus to another item. I'll throw an gif together to illustrate what I'm talking about if necessary.

Silic0nS0ldier avatar May 25 '17 23:05 Silic0nS0ldier

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jun 19 '19 05:06 stale[bot]

Completely forgot I had something do to on this. I'll add it to my list.

Silic0nS0ldier avatar Jun 23 '19 02:06 Silic0nS0ldier

This gif illustrates the issue.

repro-steps

Silic0nS0ldier avatar Jun 29 '19 07:06 Silic0nS0ldier

To be clear, this here is indeed a bug. While selecting something multiple times is something that people may want to be able to do, that strictly speaking isn't always possible as some filtering is being applied.

Back when I first created this issue, the instances of the same entry appearing was achieved by deleting different intermediate rows which evidently created some confusion.

Silic0nS0ldier avatar Jun 29 '19 07:06 Silic0nS0ldier