Summary: This adds a new event `onSearchBarCancelPressed` that fires when the user presses the cancel button on the search bar in the navigation bar. `onSearchBarUpdated` does indirectly fire when the user presses cancel, as the query will be reset to an empty string, but it is not possible to distinguish those events from the user simply resetting the query. My use case for this is to have a view that appears on top of the normal content of the view controller when the search bar is focused. Test Plan: ran `npm run test-js` and confirmed added JS unit tests passed. I also tested this with my app, and confirmed the `onSearchBarCancelPressed` method was called when I pressed the cancel button.
|
|
||
103 |
|
103 |
|
104 |
|
104 |
|
105 |
|
105 |
|
|
106 |
|
|
|
107 |
|
|
|
108 |
|
|
|
109 |
|
|
|
110 |
|
|
|
111 |
|
|
|
112 |
|
|
|
113 |
|
|
|
114 |
|
|
|
115 |
|
|
|
||
22 |
|
22 |
|
23 |
|
23 |
|
24 |
|
24 |
|
|
25 |
|
|
|
26 |
|
|
25 |
|
27 |
|
|
|
||
62 |
|
62 |
|
63 |
|
63 |
|
64 |
|
64 |
|
|
65 |
|
|
|
66 |
|
|
|
67 |
|
|
|
68 |
|
|
|
69 |
|
|
|
70 |
|
|
65 |
|
71 |
|
66 |
|
72 |
|
67 |
|
73 |
|
|
|
||
13 |
|
13 |
|
14 |
|
14 |
|
15 |
|
15 |
|
16 |
|
|
|
|
16 |
|
|
17 |
|
17 |
|
18 |
|
18 |
|
19 |
|
19 |
|
|
|
||
105 |
|
105 |
|
106 |
|
106 |
|
107 |
|
107 |
|
|
108 |
|
|
|
109 |
|
|
|
110 |
|
|
|
111 |
|
|
108 |
|
112 |
|
109 |
|
113 |
|
110 |
|
114 |
|
|
|
||
39 |
|
39 |
|
40 |
|
40 |
|
41 |
|
41 |
|
|
42 |
|
|
42 |
|
43 |
|
43 |
|
44 |
|
44 |
|
45 |
|
|
|
||
156 |
|
156 |
|
157 |
|
157 |
|
158 |
|
158 |
|
|
159 |
|
|
159 |
|
160 |
|
160 |
|
161 |
|
161 |
|
162 |
|
|
|
||
173 |
|
174 |
|
174 |
|
175 |
|
175 |
|
176 |
|
|
177 |
|
|
|
178 |
|
|
|
179 |
|
|
|
180 |
|
|
176 |
|
181 |
|
177 |
|
182 |
|
178 |
|
183 |
|
|
|
||
182 |
|
187 |
|
183 |
|
188 |
|
184 |
|
189 |
|
|
190 |
|
|
185 |
|
191 |
|
186 |
|
192 |
|
187 |
|
193 |
|
|
|
||
215 |
|
221 |
|
216 |
|
222 |
|
217 |
|
223 |
|
|
224 |
|
|
|
225 |
|
|
|
226 |
|
|
|
227 |
|
|
|
228 |
|
|
|
229 |
|
|
|
230 |
|
|
|
231 |
|
|
218 |
|
232 |
|
219 |
|
233 |
|
|
|
||
58 |
|
58 |
|
59 |
|
59 |
|
60 |
|
60 |
|
|
61 |
|
|
|
62 |
|
|
|
63 |
|
|
|
64 |
|
|
|
65 |
|
|
|
66 |
|
|
61 |
|
67 |
|
62 |
|
68 |
|
63 |
|
69 |
|
|
|
||
19 |
|
19 |
|
20 |
|
20 |
|
21 |
|
21 |
|
22 |
|
|
|
|
22 |
|
|
|
23 |
|
|
23 |
|
24 |
|
24 |
|
25 |
|
25 |
|
26 |
|
|
|
||
44 |
|
45 |
|
45 |
|
46 |
|
46 |
|
47 |
|
|
48 |
|
|
47 |
|
49 |
|
48 |
|
50 |
|
49 |
|
51 |
|
|
|
||
52 |
|
54 |
|
53 |
|
55 |
|
54 |
|
56 |
|
|
57 |
|
|
55 |
|
58 |
|
56 |
|
59 |
|
57 |
|
60 |
|
|
|
||
95 |
|
98 |
|
96 |
|
99 |
|
97 |
|
100 |
|
|
101 |
|
|
|
102 |
|
|
|
103 |
|
|
|
104 |
|
|
|
105 |
|
|
|
106 |
|
|
|
107 |
|
|
|
108 |
|
|
|
109 |
|
|
|
110 |
|
|
|
111 |
|
|
|
112 |
|
|
|
113 |
|
|
|
114 |
|
|
|
115 |
|
|
|
116 |
|
|
|
117 |
|
|
|
118 |
|
|
|
119 |
|
|
|
120 |
|
|
98 |
|
121 |
|
99 |
|
122 |
|
100 |
|
123 |
|
|
|
||
3 |
|
3 |
|
4 |
|
4 |
|
5 |
|
5 |
|
|
6 |
|
|
6 |
|
7 |
|
7 |
|
8 |
|
8 |
|
9 |
|
|
|
||
44 |
|
45 |
|
45 |
|
46 |
|
46 |
|
47 |
|
|
48 |
|
|
|
49 |
|
|
|
50 |
|
|
|
51 |
|
|
|
52 |
|
|
|
53 |
|
|
47 |
|
54 |
|
48 |
|
55 |
|