ReviewOS

also looking at this

stacks/stx

fix(components): Progress max/indeterminate and Tooltip disabled are live props

#2008
Merged glennmichael123 wants to merge fix/progress-tooltip-reactive-props into main
5 files +242 -17
packages/components/src/ui/tooltip/Tooltip.stxmodified+5-2
Changes to packages/components/src/ui/tooltip/Tooltip.stx
@@ -26,13 +26,16 @@ export const arrowClass = `absolute w-0 h-0 border-4 border-transparent ${arrowC
2626
2727<script client>
2828const delay = {{ delay }}
29const isDisabled = {{ disabled }}
29// A live prop: a tooltip is commonly suppressed by state the page only learns
30// about later — while a field is being edited, or once a hint has been read —
31// and frozen it could only ever reflect the state the page was built in.
32const isDisabled = useReactiveProp('disabled', {{ disabled }})
3033// Reactive prop binding — parent can drive `show` via signals. See #1704.
3134const isVisible = useReactiveProp('show', {{ show }})
3235let timeoutId = null
3336
3437function showTooltip() {
35 if (isDisabled) return
38 if (isDisabled()) return
3639 if (delay > 0) {
3740 timeoutId = setTimeout(() => isVisible.set(true), delay)
3841 }