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

Created on 12 Feb 2018  Â·  9Comments  Â·  Source: craftcms/cms

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

  • Craft version: RC9
  • PHP version: 7.0.27
  • Database driver & version: MySQL 5.7.21
bug minor

Most helpful comment

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.

All 9 comments

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

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.

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

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

Any chance this is going to make it into 3.2 ?

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.

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.

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.

@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

Was this page helpful?
0 / 5 - 0 ratings