mirror of https://github.com/zulip/zulip.git
341f3a1ce2
We've had a series of bugs where tooltips get leaked when a message list is rerendered. For some tooltips, we used a 'mutation observer' to remove the tooltip in this situation, but this was expensive and messy. We replace this with a Tippy plugin to keep track of this class of tooltips, with a central hook to remove them during rendering. Message lists are rerendered in the background in a variety of situations; a simple way to trigger it is clicking the mute/unmute topic/stream button in the topic menu/stream menu and the clickable area overlaps with the message list tooltips area. If a tooltip was visible at the time, the tooltip loses its reference due to the re-rendering removing its DOM element, appearing at the top-left corner. To prevent this behavior for all message list tooltips, we need to store all instances of the message list tooltips and then destroy them if the instances does refer to something else then document.body using the 'destroy_all_message_list_instances' function just before re-rendering. Whenever the message list is rendered, all the message list tooltips will be destroyed if they do not refer to document.body. This prevents the double appearance of those tooltips if the reference is removed from the DOM. This plugin allows us to remove the mutation observers and net delete code while hopefully fixing this bug for the whole app. |
||
---|---|---|
.. | ||
e2e-tests | ||
generated | ||
html | ||
images | ||
shared | ||
src | ||
styles | ||
templates | ||
tests | ||
third | ||
.browserslistrc | ||
.gitignore | ||
babel.config.js | ||
debug-require-webpack-plugin.ts | ||
debug-require.js | ||
postcss.config.js | ||
webpack.assets.json | ||
webpack.config.ts | ||
webpack.dev-assets.json |