Giter Site home page Giter Site logo

Comments (10)

denisborovikov avatar denisborovikov commented on May 12, 2024 1

@elias-fadeyev Did you try to play with usePortal/portalContainer props? Tooltip can be attached to the draggable element instead of the document body. In this case, it should move with the appropriate container.

from react-popper-tooltip.

mohsinulhaq avatar mohsinulhaq commented on May 12, 2024

Please try out v2.8.2 which has a potential fix.

from react-popper-tooltip.

elias-fadeyev avatar elias-fadeyev commented on May 12, 2024

Now it works, thank you!
As a related issue, is it possible to change click listener to mousedown for outsideClickHandler? We use this tooltip inside a drag'n'drop container and, if we move the container, outsideClickHandler doesn't trigger and, as a result, the tooltip stays shown outside of the container.

from react-popper-tooltip.

mohsinulhaq avatar mohsinulhaq commented on May 12, 2024

Does it close when you drop the container?

from react-popper-tooltip.

elias-fadeyev avatar elias-fadeyev commented on May 12, 2024

No, in our case click is not triggered after dropping and it stays opened, only mouseup is fired.

from react-popper-tooltip.

mohsinulhaq avatar mohsinulhaq commented on May 12, 2024

I attach a click handler to document to handle outside click, whenever the tooltip opens. Do you know how is that not triggered? Is your mouseup or mousedown handler stopping propagation to the click handler? Basically, what I mean is that the outside click mechanism should just work irrespective of what drag action you are doing because click event is always triggered.

from react-popper-tooltip.

elias-fadeyev avatar elias-fadeyev commented on May 12, 2024

Yep, we are using react-sortablejs and it seems that it stops propagation inside mouseup handler, if an order of elements has been changed. That's why we don't have click event now, but I think it's not a big deal. I mean isn't it a strange behavior of a tooltip to stay at the same place, when the container is moved to an opposite side of the window, even if it will be hidden after that?

from react-popper-tooltip.

elias-fadeyev avatar elias-fadeyev commented on May 12, 2024

@denisborovikov. Agree, but then this tooltip will be restricted to have the body only inside the container. It won't work for a big tooltip.

from react-popper-tooltip.

denisborovikov avatar denisborovikov commented on May 12, 2024

@elias-fadeyev Does outer container have overflow: hidden? You can try to apply overflow on the inner part of the draggable element so the mutual wrapper won't cut the tooltip.

from react-popper-tooltip.

elias-fadeyev avatar elias-fadeyev commented on May 12, 2024

@denisborovikov my fault, you are absolutely right! Unfortunately, a big tooltip now works as a handle and I can use it to drag'n'drop the container, as a part of it) I'll try to find the solution for preventing this behavior. Thank you

from react-popper-tooltip.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.