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

anchor EuiPopover to location instead of element #2332

Closed
nreese opened this issue Sep 11, 2019 · 2 comments
Closed

anchor EuiPopover to location instead of element #2332

nreese opened this issue Sep 11, 2019 · 2 comments

Comments

@nreese
Copy link
Contributor

nreese commented Sep 11, 2019

The Kibana Maps application would like to use EuiPopover for tooltips. The tooltip will need to be associated to a x and y location instead of being anchored to an element. The position of the tooltip will need to be updated view prop updates so that as a user pans the map, the tooltip stays pointing to the same location on the map by shifting its location.

cc @chandlerprall

@chandlerprall
Copy link
Contributor

Were you able to get an invisible element to draw over the map and use that as an anchor?

If so, if you can get a ref to the popover and should already have the ability to manually trigger repositions:

onDrag = () => {
  if (this.state.isPopoverOpen) {
    this.popoverRef.positionPopoverFixed();
  }
}

render() {
  return (
    <EuiPopover ref={this.popoverRef} isOpen={this.state.isPopoverOpen}...>...</EuiPopover>
  )
}

@nreese
Copy link
Contributor Author

nreese commented Sep 19, 2019

Closing. Able to implement feature with anchor element. elastic/kibana#45938

@nreese nreese closed this as completed Sep 19, 2019
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

2 participants