Summary
Use case: I want a user to input data into one editor, that saves it to an already existing json. In a separate tab, I have an editor that shows the aforementioned json, where user can make changes to it. I want the first editor emptied out after any changes have been made to it.
Steps to reproduce
Code snippet:
#First editor that takes user's input (Tab 1)
user_input = st_ace(value="[]", language="json", theme="clouds_midnight")
if len(user_input) > 2:
org_json['list_of_values'] += json.loads(user_input)
#Second editor that combines user_input and original json (Tab 2)
org_json = json.loads(st_ace(value=json.dumps(org_json, indent=2), language="json", theme="clouds_midnight"))
Actual behavior:
When I make a change in Tab 2, like deleting something, it doesn’t get deleted. Since Tab 1 still has the old output, it adds the Tab 1 output once again. This can be solved by clearing out Tab 1 editor once user has committed their changes.
If anyone can suggest a workaround that would be great. Thanks in advance!