Add fixed setting to allow tooltip to be permanently rendered
This commit is contained in:
parent
35150af784
commit
4129f166e6
|
@ -22,12 +22,15 @@
|
|||
export let position = TooltipPosition.Top
|
||||
export let type = TooltipType.Default
|
||||
export let text = ""
|
||||
export let fixed = false
|
||||
|
||||
let wrapper
|
||||
let visible = false
|
||||
let hovered = false
|
||||
let left = 0
|
||||
let top = 0
|
||||
|
||||
$: visible = hovered || fixed
|
||||
|
||||
const show = () => {
|
||||
const node = wrapper?.children?.[0]
|
||||
if (!node) {
|
||||
|
@ -51,10 +54,10 @@
|
|||
return
|
||||
}
|
||||
|
||||
visible = true
|
||||
hovered = true
|
||||
}
|
||||
const hide = () => {
|
||||
visible = false
|
||||
hovered = false
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
Loading…
Reference in New Issue