Skip to content

Fix PyScript root component not hiding after render error#1347

Open
Prachi-Gupta2808 wants to merge 1 commit into
reactive-python:mainfrom
Prachi-Gupta2808:fix/pyscript-root-error-hide
Open

Fix PyScript root component not hiding after render error#1347
Prachi-Gupta2808 wants to merge 1 commit into
reactive-python:mainfrom
Prachi-Gupta2808:fix/pyscript-root-error-hide

Conversation

@Prachi-Gupta2808

Copy link
Copy Markdown

Description

Fixes the issue where a PyScript root component becomes unresponsive after an exception is raised during rendering.

Previously, the root model was updated using dict.update(), which could leave stale keys from the previous render. This caused the old DOM to remain visible instead of hiding the failed root component. The fix clears the existing root model before applying the latest update, ensuring the rendered state accurately reflects the current layout.

I have also added a regression test to verify that when a PyScript root component raises an exception during rendering, the component is removed from the page instead of leaving stale content behind.

Closes #1276

Checklist

Please update this checklist as you complete each item:

  • Tests have been developed for bug fixes or new functionality.
  • The changelog has been updated, if necessary.
  • Documentation has been updated, if necessary.
  • GitHub Issues closed by this PR have been linked.

By submitting this pull request I agree that all contributions comply with this project's open source license(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PyScript components become unresponsive on exceptions

1 participant