@@ -13,7 +13,6 @@ Adding Event Handlers
13
13
To start out we'll just display a button that, for the moment, doesn't do anything:
14
14
15
15
.. idom :: _examples/button_does_nothing
16
- :activate-result:
17
16
18
17
To add an event handler to this button we'll do three things:
19
18
@@ -22,7 +21,6 @@ To add an event handler to this button we'll do three things:
22
21
3. Add an ``"onClick": handle_event `` attribute to the ``<button> `` element.
23
22
24
23
.. idom :: _examples/button_prints_event
25
- :activate-result:
26
24
27
25
.. note ::
28
26
@@ -35,7 +33,6 @@ component. That's important if you want to use any arguments that may have beend
35
33
your component in the handler:
36
34
37
35
.. idom :: _examples/button_prints_message
38
- :activate-result:
39
36
40
37
With all that said, since our ``handle_event `` function isn't doing that much work, if
41
38
we wanted to streamline our component definition, we could pass in our event handler as a
@@ -81,7 +78,6 @@ common while still giving its usages customizablity. Consider the case below whe
81
78
want to create a generic ``Button `` component that can be used for a variety of purpose:
82
79
83
80
.. idom :: _examples/button_handler_as_arg
84
- :activate-result:
85
81
86
82
87
83
Async Event Handlers
@@ -95,7 +91,6 @@ message in the first button. However, because the event handler is asynchronous,
95
91
handler for the second button is still able to respond:
96
92
97
93
.. idom :: _examples/button_async_handlers
98
- :activate-result:
99
94
100
95
101
96
Event Data Serialization
@@ -109,7 +104,6 @@ elements. Normally this would be accessible via ``event.target.currenTime``, but
109
104
it's simply passed in under the key ``currentTime ``:
110
105
111
106
.. idom :: _examples/audio_player
112
- :activate-result:
113
107
114
108
115
109
Client-side Event Behavior
@@ -130,7 +124,6 @@ using the :func:`~idom.core.events.event` decorator and setting ``prevent_defaul
130
124
example, we can stop a link from going to the specified URL:
131
125
132
126
.. idom :: _examples/prevent_default_event_actions
133
- :activate-result:
134
127
135
128
Unfortunately this means you cannot conditionally prevent default behavior in response
136
129
to event data without writing :ref: `Custom Javascript Components `.
@@ -148,4 +141,3 @@ will cause the handler for the outer blue one to fire. Conversely, when it's off
148
141
the handler for the red element will fire.
149
142
150
143
.. idom :: _examples/stop_event_propagation
151
- :activate-result:
0 commit comments