Button Action re-triggered when tab becomes visible

I’m encountering a very strange bug where a button’s custom action is triggering WITHOUT having clicked the button.

It happens in a very specific circumstance after the button is clicked and its tab becomes hidden then visible again. When the tab becomes visible again it immediately triggers the custom action with the same stale values that existed when the button was last pressed. This repeats each time the tab is made visible again unless I manually navigate to another tab first or switch to the data view and back.

Unfortunately this is one piece of a larger Pro app that’s already in production so I cannot share the link. Could make a copy & share if desired though.

Step by Step

  • I click the ‘Start’ button on my Home tab with a custom action
    • It sets a user-specific column ‘CurrentQuestion’ to ‘begin’
    • The ‘Survey’ menu tab is set to be visible when ‘CurrentQuestion’ is not empty.
    • It then navigates to the ‘Survey’ tab
  • The app navigates to the Survey tab
  • On that tab is a ‘Submit’ button with a custom action
    • IF ‘CurrentQuestion’ = ‘save’
      • Show Notification(CurrentQuestion)
      • SetColumn(CurrentQuestion=’done’)
  • When I press Submit it works as expected by showing a notification that says ‘save’
  • The tab then shows another ‘Return to Home’ button with a custom action
    • SetColumn(CurrentQuestion=ClearValue)
    • Navigate to Home
  • This brings me back to the Home tab
  • The really weird part starts if I press the ‘Start’ button again
  • The app navigates back to the Survey tab and I immediately a notification that says ‘save’.
    • I have NOT pressed the Submit button again, it’s not even visible at this point
    • The value of CurrentQuestion is not ‘save’, so the action is somehow caching an old value that it’s using for the condition logic and the notification text
    • This repeats indefinitely UNLESS I navigate to another tab other than Home or switch from the builder view to the data view.
    • This also happens on my phone, not just in the designer.
1 Like

Interesting – this might be the cause of some very subtle bugs we’ve been trying to fix.

Sounds kind of similar to what I’ve experienced with an action on on inline list getting fired when a new row is added.

Mentioned it here with an example app:

That stemmed from one of the apps here:

@Jonathon_Kohn does this sound familiar?

1 Like

Sounds like what the clerks have been reporting to me. Curious :joy: