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

Trigger "repositioned" event after position change #196

Merged
merged 2 commits into from
Aug 3, 2016

Conversation

TrevorBurnham
Copy link
Contributor

Fixes #195.

@slorber Try this out locally and see if it works for you, OK?

@slorber
Copy link

slorber commented Aug 3, 2016

Hey, thanks it works great for my usecase you can release that :)

I use react-tether and had to hack a bit the library so that it supports something like:

      <TetherComponent
        attachment={this.props.hotspotPosition}
        targetAttachment={this.props.hotspotPosition}
        className={"onboarding-hotspot-tethered " + this.props.name}
        offset={this.props.hotspotOffset}
        constraints={[{
          to: 'scrollParent',
          attachment: 'none'
        }]}
        on={[
          {
            event: "repositioned",
            fn: this.repositionTooltip
          }
        ]}
      >

By the way, I think it would be useful to document that event system because I couldn't find anything in doc about it.

Also, would find it useful to have events for entering/leaving out-of-bound/pinned state as it would permit to avoid querying class names on tether dom node

@TrevorBurnham
Copy link
Contributor Author

Also, would find it useful to have events for entering/leaving out-of-bound/pinned state

You should be able to do that by responding to the "update" event, which fires whenever the Tether's attachment is overridden by a constraint.

@TrevorBurnham TrevorBurnham merged commit 4259a99 into master Aug 3, 2016
@TrevorBurnham TrevorBurnham deleted the repositioned-event branch August 3, 2016 15:58
@slorber
Copy link

slorber commented Aug 3, 2016

Ok thanks :)

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

Successfully merging this pull request may close these issues.

2 participants