Incorrect positioning when no place is specified
See original GitHub issueIf I don’t specify any place for an element, then desiredPlace defaults to “top”:
let desiredPlace = e.currentTarget.getAttribute('data-place') || this.props.place || 'top'
Then getPosition is called like this
let result = getPosition(e, e.currentTarget, this.tooltipRef, desiredPlace, desiredPlace, effect, offset)
with function being defined as
export default function (e, target, node, place, desiredPlace, effect, offset)
Which result in ‘place’ being always equal to ‘desiredPlace’, so
let shouldUpdatePlace = desiredPlace !== place
is always false and tooltip is shown at ‘top’, although it doesn’t necessarily fit the screen (my case).
That’s true for current npm version 3.11.2. It works fine – the appropriate (visible) place is chosen – in version 3.11.1.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:7
- Comments:5 (1 by maintainers)
Top GitHub Comments
I think this is an important issue to be fixed. On 4.0.5 this issue is still happening.
That PR was largely contributed by someone who is no longer actively working with React. We would gladly accept a patch or PR…!