Skip to content

Tooltip reposition #264

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

Closed
alexeymolchan opened this issue Feb 23, 2017 · 1 comment
Closed

Tooltip reposition #264

alexeymolchan opened this issue Feb 23, 2017 · 1 comment

Comments

@alexeymolchan
Copy link

default position in my case - place: "right", offset: {top: -80, right: -40}

looks like:
2017-02-23 13 00 16

but when tooltip doesn't have enough space, he just reposition on top of target element:

2017-02-23 13 00 01 (target element is under the tooltip)

so offset is still {top: -80, right: -40}, but place: "top"

how can i position tooltip on the right of target element if not enough space for tooltip?

@zekedroid
Copy link

zekedroid commented Mar 14, 2017

I had a similar issue and have not found a solution yet. This isn't really a bug just a missing potential feature. This feature should allow offset objects for each position. Example:

offsets={{
    top: {
        x: '-10px',
        y: '10px',
    },
    bottom: {
        y: '10px'
    },
    right: {
        x: '100px',
        y: '5px',
    }
}}

This is similar to what is implemented now except that instead of having a single offset object that applies to all positions, there would be one offset object per position. The reason I suggest here to use x and y is that it's more natural for CSS purposes since these positions are all relative to the top, left corner of the element anyways.

@wwayne any thoughts on this? It would be greatly beneficial for these edge cases where we build components that may or may not be placed on the edges of screens.

EDIT: I see there is already a PR that kinda does this already though not entirely.

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

3 participants