feat: on_render (#1231)

* feat: on_render

* docs: fix typos

* refactor: fix linter errors

* refactor: make `error` in on_render_after optional to fix benchmarks

* refactor: benchmark attempt 2

* refactor: fix linter errors

* refactor: fix formatting
This commit is contained in:
Juro Oravec 2025-06-04 19:30:03 +02:00 committed by GitHub
parent 46e524e37d
commit eceebb9696
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
24 changed files with 1793 additions and 417 deletions

View file

@ -4477,7 +4477,7 @@ class Tabs(Component):
"tabs_data": {"name": name},
}
def on_render_after(self, context, template, rendered) -> str:
def on_render_after(self, context, template, rendered, error=None) -> str:
# By the time we get here, all child TabItem components should have been
# rendered, and they should've populated the tabs list.
tabs: List[TabEntry] = context["tabs"]
@ -4530,7 +4530,7 @@ class TabItem(Component):
"disabled": disabled,
}
def on_render_after(self, context, template, content) -> None:
def on_render_after(self, context, template, content, error=None) -> None:
parent_tabs: List[dict] = context["parent_tabs"]
parent_tabs.append({
"header": context["header"],