- Issue created by @mparker17
- 🇨🇦Canada mparker17 UTC-4
I was able to get something to work by adding the following to
label_help_process_form()
...elseif (isset($item['widget']['target_id']['#type']) && $item['widget']['target_id']['#type'] === 'autocomplete_deluxe' ) { $use_case = 15; $element = &$form[$key]['widget']['target_id']; _label_help_append_title($element, $content, $use_case); }
I'll post a merge request shortly for review, but...
- I get the sense from the resulting markup that appending to the title is not ideal, from an accessibility standpoint
- I'm not certain if I should change the $use_case to a new number
... some feedback from the label_help maintainers would be ideal.
I'm also happy to submit a patch to the autocomplete_deluxe queue if that would make things easier.
- Merge request !20Issue #3534276: Add Label Help support for the Autocomplete Deluxe widget → (Open) created by mparker17
- 🇪🇨Ecuador jwilson3
Maintainer here. Thank you for the excellently written issue complete with MR!
I get the sense from the resulting markup that _label_help_append_title() is not ideal from an accessibility standpoint
You're probably right here. _label_help_append_title() is kind of the "worst case" scenario when nothing else works.
So what I recommend you do is to replace that with the other options to see if any of the other options work better and put the label help in the correct place, visually, on the form element.
_label_help_prepend_field_prefix($element, $content, $use_case);
_label_help_prepend_description($element, $content, $use_case);
_label_help_append_label_suffix($element, $content, $use_case);If any of these work better than append_title, pls update to the MR. If not, leave a comment to that effect.
Thank you!
- 🇪🇨Ecuador jwilson3
I'm not certain if I should change the $use_case to a new number
The use_case needs to be incremented to the lowest unused number. (Currently that would be 18).
- 🇨🇦Canada mparker17 UTC-4
@jwilson3, thanks for the quick response and help!
I will update the patch to set
$use_case = 18
in the new code.I tried the other other placement options to see if any worked better, and, unfortunately, they did not (details below).
So we will have to stick with
_label_help_append_title()
for now. (maybe I can submit a patch toautocomplete_deluxe
but my initial attempts at a patch haven't been successful).To be more specific...
_label_help_prepend_field_prefix($element, $content, $use_case);
The label help text wasn't output at all with prepend_field_prefix
_label_help_prepend_description($element, $content, $use_case);
The label help text appeared below/after the input box and above/before the field description, but this isn't ideal, because I need the help text above/before the input box where users will notice it. Put another way, I could get an effect similar to prepend_description by adding a newline to the description itself, so this doesn't really add anything.
_label_help_append_label_suffix($element, $content, $use_case);
The label help text wasn't output at all with append_label_suffix
- 🇨🇦Canada mparker17 UTC-4
I've pushed a commit with an updated use_case; so I'm moving this back to Needs Review. Reviews welcome! Thanks again!