You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For the markdown editor, I was able to clear the input using two yields, which avoids needing to keep updating the key name. So still pretty hacky implementation wise, so I definitely think this would be a nice API to have.
def on_click_new(e: me.ClickEvent):
state = me.state(State)
# Need to update the initial value of the editor text area so we can
# trigger a diff to reset the editor to empty. Need to yield this change.
# for this to work.
state.selected_note_content = state.notes[state.selected_note_index].content
yield
# Reset the initial value of the editor text area to empty since the new note
# has no content.
state.selected_note_content = ""
state.notes.append(Note())
state.selected_note_index = len(state.notes) - 1
yield
Context: https://github.com/google/mesop/pull/242/files#r1597977597
The text was updated successfully, but these errors were encountered: