craftcms / cms

Build bespoke content experiences with Craft.
https://craftcms.com
Other
3.25k stars 629 forks source link

“Add category” - button selectable (not hidden) when branch limit has been met #2423

Open richhayler opened 6 years ago

richhayler commented 6 years ago

Description

The “add a category” button is displayed when it should be disabled (or ideally hidden) when the “branch limit” is set to “1” and a category has already been selected.

Steps to reproduce

  1. Create a category field, point to your category source and set the branch limit to 1
  2. Create a new section and add the new category field
  3. Create a new entry in the section
  4. Select a category
  5. The “add a category” button is still selectable (should be hidden) as the branch limit has been met.

The behaviour should mimic the “add asset” button which is hidden when the number of selected images matches the limit set for the field.

Additional info

brandonkelly commented 6 years ago

This isn’t quite the same, but related to #1847 - so should be fixed alongside it.

heymarkreeves commented 6 years ago

Just adding that I was confused by this today, too, after setting a limit of 1 on a category field and seeing the button still enabled after 1 category was chosen. Happy to see a solution's underway.

owldesign commented 5 years ago

This is still happening in verison raft CMS 3.1.0-beta.7

brandonkelly commented 5 years ago

No work has been done on it yet. I’m going to try to fix it in 3.2.

richhayler commented 5 years ago

Any chance this is going to make it into 3.2 ?

KarlBishop commented 3 years ago

I also find this to be a usability issue.

After a category is selected the "add a category" button continues to be shown. Clicking it now opens up the category list again and I can select another category but it doesn't do anything. So it is potentially confusing because the UI implies that (a) I can legitimately select more than one category on this field and (b) that the functionality to add a second category is broken.

nathansnelgrove commented 3 years ago

I encountered this today while trying to set up re-orderable categories in a matrix for a client. I thought I had done something wrong, and my googling led me here.

I'm glad to see this and #1847 are somewhere in the todo list.

TheFunkyMonk commented 3 years ago

Agreed on the usability front here, the button not hiding like it does for limited entry/asset selectors is causing some confusion with a couple of clients and cluttering our CMS interface up a bit. Hopefully, this gets in soon.

clieee commented 3 years ago

@brandonkelly I know you mentioned this will be fixed in Craft 4, but is there a chance you guys could have a look at it earlier than that?

I agree with the above, the experience is lacking when that button is still clickable etc. Would be very much appreciated.

Thank you

Owen-Guo commented 3 years ago

@brandonkelly

You may have noticed the above problem, but I encountered another question. I set the "Branch Limit = 1", I got the following error when saving entry.

Additional info Craft CMS: 3.6.0.1 PHP version: 7.4.16 OS version: Linux 5.4.0-66-generic Database driver & version: MySQL 8.0.25

brandonkelly commented 3 years ago

@Owen-Guo That was fixed in 3.6.1.

stephenmatthews commented 1 year ago

@brandonkelly Is there an update on this? When the "branchLimit" is set to "1" the user can still select multiple as well as when one is already defined the "Add a category" button is still shown.

brandonkelly commented 1 year ago

No update yet, sorry, but will give it some attention soon, since the same Branch Limit setting is coming to Entries fields in Craft 4.4.

AmarHuda1 commented 8 months ago

@brandonkelly Is there an update on this? When the "branchLimit" is set to "1" the user can still select multiple as well as when one is already defined the "Add a category" button is still shown.

@brandonkelly any update for this in Craft 3?

brandonkelly commented 8 months ago

We’ve spent some time on a couple ideas, but it’s a little complicated so nothing fully implemented yet.