- Issue created by @HeikkiY
- 🇫🇮Finland HeikkiY Oulu
I debugged the problem a bit and it seems like the module is adding a custom validation message here: https://git.drupalcode.org/project/decorative_image_widget/-/blob/1.0.x/...
This does not seem to get triggered with the Ajax form in the media library modal.
Also it seems like the field is still marked as optional in both places (/media/add/image and media library modal). You do get an error message when trying to submit the form without alternative text but I think both fields should have the required asterix indicator also when no alternative text is provided and the decorative image checkbox is unchecked.
- 🇫🇮Finland HeikkiY Oulu
To add to this issue, there is a second UX problem because currently the help text for alternative text says:
Short description of the image used by screen readers and displayed when the image is not loaded. This is important for accessibility. If alternative text is not applicable, leave this field empty.This is a bit confusing because the user needs to try and submit the form before there is any indication that the alternative text is required.
- @heikkiy opened merge request.
- 🇫🇮Finland HeikkiY Oulu
I added the following patch to the issue:
1. It improves the description text for the Alternative text to take into account the new checkbox.
2. It adds new functionality to the JS which first of all triggers the alternative text as required based on the checkbox and also marks the label field as required to add the Drupal required ::after element to it. - Status changed to Needs review
about 1 year ago 5:06am 30 March 2023 - Status changed to Needs work
about 1 year ago 9:00pm 19 May 2023 - 🇫🇮Finland HeikkiY Oulu
@lukeleber
I understand what you mean and I agree on the part that it's not on the scope of the issue. I would still argue that it would be also better to improve the alternative text also. We have had some feedback from our clients that they do not understand the setting.
I will update the ticket description and title to take those into account.
- Status changed to Needs review
about 1 year ago 5:17am 20 May 2023 - Status changed to RTBC
about 1 year ago 1:50pm 22 May 2023 - 🇺🇸United States Luke.Leber Pennsylvania
The JS changes in !2 look good - manually tested against 9.4.x + Claro and 9.4.x + Gin and the required-ness looks and feels like other required fields when the decorative checkbox is unticked.
+1 RTBC.
- 🇬🇧United Kingdom aaron.ferris
Thanks for this patch, I've just pulled this module down and was noticing this exact behaviour which is a potential UX problem. Works well and applies cleanly to 1.0.0-alpha4. +1 for this patch!
- Status changed to Fixed
9 months ago 12:39am 8 October 2023 - 🇺🇸United States bkosborne New Jersey, USA
Looks good. Tested this with Drupal 10.1 using Claro, both when uploading an image via the media library and when doing it directly from a media add form.
-
bkosborne →
committed b31421f8 on 1.0.x authored by
HeikkiY →
Issue #3340547 by HeikkiY, Luke.Leber, aaron.ferris: Media library does...
-
bkosborne →
committed b31421f8 on 1.0.x authored by
HeikkiY →
Automatically closed - issue fixed for 2 weeks with no activity.