Use separate class for tippy targets (#20742)
Previous solution that re-purposed the 'hide' class by making it `!important` had various unintended side-effects where jQuery .show() was not able to outweight it. Use a separate class to prevent these interactions.
This commit is contained in:
parent
58de07e5fd
commit
d751e35d81
6 changed files with 13 additions and 7 deletions
|
@ -12,10 +12,11 @@ export function createTippy(target, opts = {}) {
|
|||
...opts,
|
||||
});
|
||||
|
||||
// for popups where content refers to a DOM element, we use the 'hide' class to initially hide
|
||||
// the content, now we can remove it as the content has been removed from the DOM by tippy
|
||||
// for popups where content refers to a DOM element, we use the 'tippy-target' class
|
||||
// to initially hide the content, now we can remove it as the content has been removed
|
||||
// from the DOM by tippy
|
||||
if (opts.content instanceof Element) {
|
||||
opts.content.classList.remove('hide');
|
||||
opts.content.classList.remove('tippy-target');
|
||||
}
|
||||
|
||||
return instance;
|
||||
|
|
|
@ -1315,7 +1315,7 @@ footer {
|
|||
}
|
||||
|
||||
.hide {
|
||||
display: none !important;
|
||||
display: none;
|
||||
|
||||
&.show-outdated {
|
||||
display: none !important;
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
/* styles are based on node_modules/tippy.js/dist/tippy.css */
|
||||
|
||||
// class to hide tippy target elements on page load
|
||||
.tippy-target {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
[data-tippy-root] {
|
||||
max-width: calc(100vw - 10px);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue