Skip to content

Commit 88f70a5

Browse files
committed
fix: Preserve search text in table filtering example #150
1 parent f336eee commit 88f70a5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

py/examples/table_filter_backend.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,12 @@ async def main(q: Q):
4343
])
4444
q.client.initialized = True
4545
else:
46-
table = q.page['form'].items[1].table
46+
items = q.page['form'].items
47+
search_box = items[0].textbox
48+
table = items[1].table
4749
term: str = q.args.search
4850
term = term.strip() if term else ''
51+
search_box.value = term
4952
table.rows = df_to_rows(search_df(addresses, term) if len(term) else addresses)
5053

5154
await q.page.save()

0 commit comments

Comments
 (0)