title: How to trigger functions with plotly-dash button inside a tab in python?
body: <p>I am quite new to programming and to plotly dash as well. I have some tabs in my dashboard and in each tab i have a text input box (int) and a button that triggers some calculations using the input.</p>
  <p>With the following script, when I select the tab, the callback is triggered and the calculation already starts with the empty value in the text, even before I click the button. I do have an if clause to return nothing when the text input box is empty. But that doesn't seem to be working. It directly goes to the final &quot;else&quot; clause. How can i solve this? Thank you!</p>
  <pre><code>@app.callback(Output('PRINTOUTPUT', 'children'),
                [Input('create_button', 'n_clicks'),
                Input('selection_tabs', 'value')],
                [State('text-input', 'value')])
  
  def xyz (clicks, selected_tab, textinput):    
      
      changed_id = [p['prop_id'] for p in dash.callback_context.triggered][0] #To determine if n_clicks is changed. 
  
        
      if 'create_button' not in changed_id:
          return &quot;&quot;
  
      elif 'create_button' in changed_id:           
          if textinput ==&quot;&quot;:  #Do nothing if button is clicked and input num is blank.            
              return &quot;No input&quot;
          
          else: 
              #Do some calculations based on the selected tab and input
               return &quot;Successful&quot;
  </code></pre>