Tooltip incompatibility with Gin Admin Theme

Created on 31 August 2023, over 1 year ago
Updated 21 April 2024, 8 months ago
Note - this issue may be resolvable in the Gin issue queue. I'm unsure at this time. After briefly chatting with Jacob and Sascha in Slack, I'm filing this under Webform, but depending on how the investigation goes and what the root ends up being, may move over to Gin if it's more straight-forward to resolve in that scope without unintentional side-effects

Problem/Motivation

When using the Gin Admin Theme, tooltips seem to sometimes render in incorrect places -- sometimes even completely off the viewport. The core claro admin theme works perfectly, so I believe that there are some differences in the Gin styles and/or markup that are throwing a monkey-wrench into what TippyJS is doing. It seems to only affect checkbox and radio form element types (?).

Steps to reproduce

  1. Install Webform 6.2.x and Gin on Drupal Core 9.5.x
  2. Navigate to the build tab on the out-of-the-box "Contact" form
  3. Edit the "Your Name" element
  4. Expand the "Form validation" details element
  5. Hover over the "Required", "Unique", and "Pattern" question mark bubbles -- note that the tooltip does not render properly.
  6. Hover over the "Required message" and "Counter" question mark bubbles -- note that the tooltip does render properly.

Proposed resolution

TBD.

Remaining tasks

  1. Determine the root cause.
  2. Triage to the most effective module.
  3. Resolve.

User interface changes

None

API changes

None

Data model changes

None

🐛 Bug report
Status

Fixed

Version

6.2

Component

Code

Created by

🇺🇸United States luke.leber Pennsylvania

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @luke.leber
  • 🇺🇸United States luke.leber Pennsylvania

    https://git.drupalcode.org/project/gin/-/blame/8.x-3.x/styles/base/_form... seems to be the critical difference between Gin and Claro in this regard.

    Is PopperJS having some trouble when the inline <label> with position: relative? Changing the position property back to static seems to make things work with Gin -- but I'm assuming that position: relative was intentionally set to create a new stacking context.

    Might want to pull Sascha in for a consultation here?

  • 🇨🇭Switzerland saschaeggi Zurich

    Pretty sure we added this on purpose for the z-index: 1; to work. So if we would want to remove position: relative; we would need to make sure we don't break labels.

  • Status changed to Needs review over 1 year ago
  • 🇺🇸United States jrockowitz Brooklyn, NY

    Here is a quick fix to change the labels to not use relative positioning.

  • 🇮🇳India kasli_harshit

    HI @jrockowitz i have reviewed the Patch(#4) it is applied successfully now the tooltip message are rendering properly. Attaching the screenshot for the same. We can move this to RTBC+1.
    Just to highlight : Before applying the patch in some of the cases the tooltip message in not even showing in the viewport. But working fine after the patch.

  • Status changed to Needs work about 1 year ago
  • 🇺🇸United States luke.leber Pennsylvania

    Hey Jacob,

    It looks like there are some visual regressions from #4.

    `position: static !important` is clobbering some styles applied by the .visually-hidden class. Under the Advanced tab, the Wrapper CSS classes field, select 'custom', and observe that with the patch, the visually hidden label on the attributes-class-other field is now visible, and scrunched up due to the other properties coming from .visually-hidden

    This looks like it might be quite the pickle...hmm.

  • Status changed to Fixed 9 months ago
  • 🇺🇸United States jrockowitz Brooklyn, NY

    Yep, this is a game of whack-a-mole, but the approach from #6 is definitely an improvement. I am going to commit it.

    • 6041c1af committed on 6.2.x
      Issue #3384432: Tooltip incompatibility with Gin Admin Theme
      
  • 🇺🇸United States jrockowitz Brooklyn, NY
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024