Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tooltip not getting displayed with disabled checkbox #1211

Closed
nreese opened this issue Sep 25, 2018 · 7 comments
Closed

Tooltip not getting displayed with disabled checkbox #1211

nreese opened this issue Sep 25, 2018 · 7 comments
Assignees

Comments

@nreese
Copy link
Contributor

nreese commented Sep 25, 2018

The following does not display a tooltip

      <EuiToolTip
        position="left"
        content={`Map is at zoom level ${zoom}.
          This layer is only visible between zoom levels ${minZoom} to ${maxZoom}.`}
      >
        <EuiCheckbox
          id={layer.getId()}
          checked={layer.isVisible()}
          onChange={() => {}}
          disabled
        />
      </EuiToolTip>

cc @chandlerprall

@chandlerprall chandlerprall self-assigned this Sep 25, 2018
@chandlerprall
Copy link
Contributor

The tooltip isn't trigged as disabled inputs don't trigger mouse events. This can be fixed by adding pointer-events: none; to any children of a tooltip, but then the mouse cursor does not change to the disabled state when hovering over the checkbox. Thoughts @snide @cchaos ?

@snide
Copy link
Contributor

snide commented Sep 27, 2018

I think it's probably more important to see the tooltip then maintain the cursor state. If that works I'm OK with it.

@cchaos
Copy link
Contributor

cchaos commented Sep 27, 2018

pointer-events: none; to any children of a tooltip

only when disabled? Or always?

@chandlerprall
Copy link
Contributor

@cchaos only when disabled

@cchaos
Copy link
Contributor

cchaos commented Sep 27, 2018

My worry is the unintended side effects of not allowing any interaction with children of a tooltip. How will the tooltip know if the children are disabled? How will it know all children are disabled? Do you have to pass disabled to the tooltip itself?

@chandlerprall
Copy link
Contributor

This is already done with top-level disabled children - https://github.com/elastic/eui/blob/master/src/components/tool_tip/_tool_tip.scss#L77-L84

The change is removing the direct-descendent selector.

@cchaos
Copy link
Contributor

cchaos commented Sep 27, 2018

Ahhh ok, i see. Sure we can try it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants