norcross / gravity-tooltips

Adds a custom field to each form element for tooltips
MIT License
74 stars 20 forks source link

Misplacement of the tooltip when using file upload fields #15

Closed thepofo closed 8 years ago

thepofo commented 9 years ago

When using the file upload field, the span including the tooltip icon is placed inside the ginput_container, even inside the multifile upload div. See screenshot

screen shot 2015-01-06 at 00 34 37

This is how it is done using the other fields. screen shot 2015-01-06 at 00 36 42

That way positioning the icon next to the label is impossible

osakagreg commented 8 years ago

Try this... Edit lib/front.php

find: static function render_tooltip_single( $content, $tooltip ) {

and replace the line:

  return GF_Tooltips::str_replace_limit( '</div>', '</div>' . $icon, $content );

with:

  return GF_Tooltips::str_replace_limit( '</label>', '</label>' . $icon, $content );

I downloaded this today (7/13/2015) and had the same problem, Making this modification (above) corrected it. I haven't looked through the code enough to see if it generates problems elsewhere, but so far so good.

Please let me know us know if that helps.

norcross commented 8 years ago

I'm actually overhauling this to use a pure CSS method, with a lot better control over filtering and layout, so keep an eye on it. otherwise you can patch your version if need be.

norcross commented 8 years ago

closing this for now. the new output is showing up correctly in my testing, so it may be fixed or possibly an issue with how your output is done. in addition, you can now filter the field on a per-form or per-field basis