Commit 3024e7b
gambletan
fix: Tab initialized with interactive=False cannot be updated to True
When a Tab's `interactive` prop changed via gr.Tab(interactive=True),
the `tabs` array in Tabs.svelte was updated by register_tab, but the
`visible_tabs` and `overflow_tabs` arrays (which the template actually
renders from) retained stale tab objects. These arrays are only
refreshed by handle_menu_overflow, which is async (awaits tick()) and
relies on DOM measurements.
Unlike `visible` changes—which trigger DOM structural changes in the
hidden measurement container, cascading through element bindings to
re-trigger handle_menu_overflow—`interactive` changes cause no DOM
structural changes, so visible_tabs never gets the updated tab data.
The fix adds a synchronous reactive block that keeps visible_tabs and
overflow_tabs tab objects in sync with the canonical tabs array whenever
any tab property changes.
Closes #13033
Signed-off-by: Tan <alvinttang@gmail.com>1 parent 73d4065 commit 3024e7b
File tree
1 file changed
+20
-0
lines changed1 file changed
+20
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
35 | 55 | | |
36 | 56 | | |
37 | 57 | | |
| |||
0 commit comments