also looking at this
fix(components): Progress max/indeterminate and Tooltip disabled are live props
#2008
5 files
+242
-17
| @@ -26,13 +26,16 @@ export const arrowClass = `absolute w-0 h-0 border-4 border-transparent ${arrowC | ||
| 26 | 26 | |
| 27 | 27 | <script client> |
| 28 | 28 | const delay = {{ delay }} |
| 29 | const 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. | |
| 32 | const isDisabled = useReactiveProp('disabled', {{ disabled }}) | |
| 30 | 33 | // Reactive prop binding — parent can drive `show` via signals. See #1704. |
| 31 | 34 | const isVisible = useReactiveProp('show', {{ show }}) |
| 32 | 35 | let timeoutId = null |
| 33 | 36 | |
| 34 | 37 | function showTooltip() { |
| 35 | if (isDisabled) return | |
| 38 | if (isDisabled()) return | |
| 36 | 39 | if (delay > 0) { |
| 37 | 40 | timeoutId = setTimeout(() => isVisible.set(true), delay) |
| 38 | 41 | } |