mirror of
https://github.com/zulip/zulip.git
synced 2026-06-24 21:08:25 +08:00
We destroy the tooltips for which `reference` was either removed from DOM or is hidden. We only need to do this for tooltips contained in simplebar containers for which tooltips can overflow the boundary of the simplebar container. There are 4 approaches we could have done this: 1. Asked tippy.js maintainers to do this for us. In https://github.com/atomiks/tippyjs/issues/938 the maintainer said that it is the responsibility of the user to do so. 2. Tracked whenever we update the DOM for such elements and hide tooltips when we were hiding the `reference` elements. This had various problems like it is hard trigger events when certain elements have been removed from DOM when `html()` method is used to render new content. 3. Run an `optimized` periodic job to destroy tooltips when `reference` elements are hidden. This isn't a good method to do this since it sucks power and adds latency. 4. Use a `MutationObserver` on the parent element and watch for changes. This methods seems to work well with no bad side effects. We use this approach. |
||
|---|---|---|
| .. | ||
| assets | ||
| audio | ||
| generated | ||
| html | ||
| images | ||
| js | ||
| shared | ||
| styles | ||
| templates | ||
| third | ||
| .gitignore | ||