Skip to content

Restore pristine / initial state after insert #561

Discussion options

You must be logged in to vote

Hi @ahmedrshdy
To reset state you can simply use the Reset action. Alternatively setting the input values to null will have the same effect in this case. So consider:

events:
      onClick:
        - id: validate
          type: Validate
        - id: add_professional
          type: Request
          params: insert_professional
        - id: pristine
          type: Reset
        - id: close_drawer
          type: CallMethod
          params:
            blockId: add_professional_drawer
            method: toggleOpen

In Lowdefy we are a little more strict about types in state than vanilla js to make the behavior of state more predictable. The enforceType method is used to initialize all …

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@Gervwyk
Comment options

@AhmedBytesBits
Comment options

Answer selected by AhmedBytesBits
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #560 on April 29, 2021 05:42.