I would like to see some sort of visual indication to the user that a field is required for publication. I think this would be something like indication similar to the required star (maybe a blue circle instead of a red star?)
I would like to see some sort of visual indication to the user that a field is required for publication. I think this would be something like indication similar to the required star (maybe a blue circle instead of a red star?)
Comments
Comment #2
mpriscella commentedThis was actually next on my internal roadmap! After consulting with some of the UX designers on my team we are going to test out an orange star similar to the required star so users have some frame of reference as to what the indicator is for. If it doesn't look good in practice we'll play around with some other ideas (blue circle, orange triangle, whatever), but there will be something!
Comment #3
Snugug commentedAn accessibility best practice is to not distinguish items based solely on color. As such, I'd recommend not just an orange star. Keep the position and size the same for context, but changing color/shape.
Comment #4
mpriscella commentedThanks for the feedback, that's a really good point! I'll make sure that any indicator conforms with accessibility best practice.
Comment #5
Snugug commentedHey, curious what the status on this is. Thanks!
Comment #6
mpriscella commentedHey! Sorry for the delay, I had been trying to determine what the best solution for adding a class to an arbitrary field element and it's a lot trickier than it seems, although I think I found a solution (hacky as it feels to me). I believe this fix is close to being done, but work has been crazy recently and I haven't had time to finish this. I'm attaching a patch of what I currently have (sorry in advance for any placeholder code), please let me know if you have any suggestions!
Known outstanding issues are:
Comment #7
Snugug commentedI applied your patch and I couldn't tell whether or not it was applying classes correctly. It didn't appear to be in some of my basic tests. If you can get a patch that applies the required I can help with the CSS
Comment #8
Snugug commentedI've taken another look at this patch, and while it does appear to be applying the
required-on-publishclass to some input element, it doesn't appear to apply it to the label of the input element, which is where the styling is applied for the Drupal standard required indicator.In my little test, it appears to apply the
required-on-publishclass correctly to longform text areas, but didn't appear to apply them correctly on a number field I have, or a YouTube field I have. I don't know if updating this to apply to labels instead of fields will help w/thatComment #9
mpriscella commentedUploaded a new patch which adds a light blue circle to each field that is required for publishing. I'm not 100% married to the color, so if you have any suggestions please let me know!
Comment #10
mpriscella commentedComment #11
Snugug commentedHuzzah! This works great!
Talked this over with the designer I work with and I think I have a thought for the indicator. We think a regular blue triangle may be better than a light blue circle as the light blue is a little hard to see against white backgrounds, and a circle vs the default red * may be a little hard to distinguish at a glance. I've taken a screenshot of what we've put together and the CSS that I'm using to get there.
One comment I see while I'm going through and testing is that the class doesn't appear to be applied correctly to fields brought in via https://www.drupal.org/project/paragraphs. That's a big usecase for us, and it'd be great if we could get that working.Actually, it appears as if it does work with Paragraphs, but there's some weird behavior between a Paragraph reference that's required and fields inside that reference that are required to save vs publish. I'm not sure I have that particular usecase right now so I think this is ok!Comment #12
mpriscella commentedGreat! I've added a new issue #2994476: Add Paragraphs Support so we can get this change out at least and continue a discussion on how to extend support to paragraphs there.
Comment #13
mpriscella commentedSwitched the filenames while doing the interdiff :facepalm:
Comment #15
mpriscella commentedComment #17
mlncn commentedCreated #3105495: Indicate required on publish to people using screenreaders as an accessibility follow-up.