mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
Fix when tooltip changes before tooltipObject is created (#1845)
It can happen in TagWithTooltip.svelte when a tag is normalized beause of leading/trailing delimiter
This commit is contained in:
parent
890b28c1e8
commit
9d98c62d50
1 changed files with 5 additions and 3 deletions
|
@ -43,10 +43,12 @@
|
||||||
let previousTooltip: string = tooltip;
|
let previousTooltip: string = tooltip;
|
||||||
$: if (tooltip !== previousTooltip) {
|
$: if (tooltip !== previousTooltip) {
|
||||||
previousTooltip = tooltip;
|
previousTooltip = tooltip;
|
||||||
|
if (tooltipObject !== undefined) {
|
||||||
const element: HTMLElement = tooltipObject["_element"];
|
const element: HTMLElement = tooltipObject["_element"];
|
||||||
tooltipObject.dispose();
|
tooltipObject.dispose();
|
||||||
createTooltip(element);
|
createTooltip(element);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<slot {createTooltip} {tooltipObject} />
|
<slot {createTooltip} {tooltipObject} />
|
||||||
|
|
Loading…
Reference in a new issue