mirror of
https://github.com/gradio-app/gradio.git
synced 2024-11-21 01:01:05 +08:00
Fix bug where updating a component's value in reload mode would not be shown in UI (#8227)
* Update code * add changeset * lint * Add code * add changeset --------- Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
This commit is contained in:
parent
22df61a26a
commit
9ece050a70
5
.changeset/wicked-chairs-wait.md
Normal file
5
.changeset/wicked-chairs-wait.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
"gradio": patch
|
||||
---
|
||||
|
||||
fix:Fix bug where updating a component's value in reload mode would not be shown in UI
|
@ -312,6 +312,8 @@ def reassign_keys(old_blocks: Blocks, new_blocks: Blocks):
|
||||
old_block.__class__ == new_block.__class__
|
||||
and old_block is not None
|
||||
and old_block.key not in assigned_keys
|
||||
and json.dumps(getattr(old_block, "value", None))
|
||||
== json.dumps(getattr(new_block, "value", None))
|
||||
):
|
||||
new_block.key = old_block.key
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user