MCPcopy Index your code
hub / github.com/plotly/dash / triggered

Method triggered

dash/_callback_context.py:67–85  ·  view source on GitHub ↗

Returns a list of all the Input props that changed and caused the callback to execute. It is empty when the callback is called on initial load, unless an Input prop got its value from another initial callback. Callbacks triggered by user actions typically have one item in tr

(self)

Source from the content-addressed store, hash-verified

65 @property
66 @has_context
67 def triggered(self):
68 """
69 Returns a list of all the Input props that changed and caused the callback to execute. It is empty when the
70 callback is called on initial load, unless an Input prop got its value from another initial callback.
71 Callbacks triggered by user actions typically have one item in triggered, unless the same action changes
72 two props at once or the callback has several Input props that are all modified by another callback based on
73 a single user action.
74
75 Example: To get the id of the component that triggered the callback:
76 `component_id = ctx.triggered[0]['prop_id'].split('.')[0]`
77
78 Example: To detect initial call, empty triggered is not really empty, it's falsy so that you can use:
79 `if ctx.triggered:`
80 """
81 # For backward compatibility: previously `triggered` always had a
82 # value - to avoid breaking existing apps, add a dummy item but
83 # make the list still look falsy. So `if ctx.triggered` will make it
84 # look empty, but you can still do `triggered[0]["prop_id"].split(".")`
85 return getattr(_get_context_value(), "triggered_inputs", []) or falsy_triggered
86
87 @property
88 @has_context

Callers

nothing calls this directly

Calls 1

_get_context_valueFunction · 0.85

Tested by

no test coverage detected