Skip to content

Tooltip target requires string, but Tether takes object?  #337

@mawburn

Description

@mawburn

version: 4.1.1
components: Tooltip

I'm not sure if this is intended functionality or not, I might be overlooking it, but I can't find anything in the issues concerning this.

But when using the tooltip it requires a target ID string, however Tether can take a DOM Object, ID, etc. I can get around this by giving it a junk ID that I threw on some html in the top level component, then setting the target directly inside the tether prop using the event.target coming from a child component.

eg:

<Tooltip
    isOpen={this.state.tooltipOpen}
    target="junkidcuzwhousesidsinreact"
    tether={{target: this.state.tooltipTarget}}
    toggle={this.toggle}
>
    I'm a tooltip.
</Tooltip>

This seems very hacky solution to me and it feels like target should accept the same proptypes that Tether can.

target: The DOM element, jQuery element, or a selector string of an element which the element will be attached to

http://tether.io/#options

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions