@@ -279,9 +279,7 @@ defmodule Scenic.Component.Input.Dropdown do
279
279
rotate_caret: rotate_caret
280
280
}
281
281
282
- push_graph ( graph )
283
-
284
- { :ok , state }
282
+ { :ok , state , push: graph }
285
283
end
286
284
287
285
# ============================================================================
@@ -312,15 +310,14 @@ defmodule Scenic.Component.Input.Dropdown do
312
310
graph
313
311
|> Graph . modify ( @ caret_id , & update_opts ( & 1 , rotate: rotate_caret ) )
314
312
|> Graph . modify ( @ dropbox_id , & update_opts ( & 1 , hidden: false ) )
315
- |> push_graph ( )
316
313
317
314
state =
318
315
state
319
316
|> Map . put ( :down , true )
320
317
|> Map . put ( :drop_time , :os . system_time ( :milli_seconds ) )
321
318
|> Map . put ( :graph , graph )
322
319
323
- { :noreply , state }
320
+ { :noreply , state , push: graph }
324
321
end
325
322
326
323
# ============================================================================
@@ -333,11 +330,9 @@ defmodule Scenic.Component.Input.Dropdown do
333
330
% { down: true , items: items , graph: graph , selected_id: selected_id , theme: theme } = state
334
331
) do
335
332
# set the appropriate hilighting for each of the items
336
- graph =
337
- update_highlighting ( graph , items , selected_id , id , theme )
338
- |> push_graph
333
+ graph = update_highlighting ( graph , items , selected_id , id , theme )
339
334
340
- { :noreply , % { state | hover_id: id , graph: graph } }
335
+ { :noreply , % { state | hover_id: id , graph: graph } , push: graph }
341
336
end
342
337
343
338
# --------------------------------------------------------
@@ -347,11 +342,9 @@ defmodule Scenic.Component.Input.Dropdown do
347
342
% { down: true , items: items , graph: graph , selected_id: selected_id , theme: theme } = state
348
343
) do
349
344
# set the appropriate hilighting for each of the items
350
- graph =
351
- update_highlighting ( graph , items , selected_id , nil , theme )
352
- |> push_graph
345
+ graph = update_highlighting ( graph , items , selected_id , nil , theme )
353
346
354
- { :noreply , % { state | hover_id: nil , graph: graph } }
347
+ { :noreply , % { state | hover_id: nil , graph: graph } , push: graph }
355
348
end
356
349
357
350
# --------------------------------------------------------
@@ -377,10 +370,8 @@ defmodule Scenic.Component.Input.Dropdown do
377
370
# raise the dropdown
378
371
|> Graph . modify ( @ caret_id , & update_opts ( & 1 , rotate: @ rotate_neutral ) )
379
372
|> Graph . modify ( @ dropbox_id , & update_opts ( & 1 , hidden: true ) )
380
- # push to the viewport
381
- |> push_graph ( )
382
373
383
- { :noreply , % { state | down: false , graph: graph } }
374
+ { :noreply , % { state | down: false , graph: graph } , push: graph }
384
375
end
385
376
386
377
# --------------------------------------------------------
@@ -407,12 +398,11 @@ defmodule Scenic.Component.Input.Dropdown do
407
398
|> update_highlighting ( items , selected_id , nil , theme )
408
399
|> Graph . modify ( @ caret_id , & update_opts ( & 1 , rotate: @ rotate_neutral ) )
409
400
|> Graph . modify ( @ dropbox_id , & update_opts ( & 1 , hidden: true ) )
410
- |> push_graph ( )
411
401
412
402
# release the input capture
413
403
ViewPort . release_input ( context , [ :cursor_button , :cursor_pos ] )
414
404
415
- { :noreply , % { state | down: false , hover_id: nil , graph: graph } }
405
+ { :noreply , % { state | down: false , hover_id: nil , graph: graph } , push: graph }
416
406
end
417
407
end
418
408
@@ -438,10 +428,8 @@ defmodule Scenic.Component.Input.Dropdown do
438
428
# raise the dropdown
439
429
|> Graph . modify ( @ caret_id , & update_opts ( & 1 , rotate: @ rotate_neutral ) )
440
430
|> Graph . modify ( @ dropbox_id , & update_opts ( & 1 , hidden: true ) )
441
- # push to the viewport
442
- |> push_graph ( )
443
431
444
- { :noreply , % { state | down: false , graph: graph } }
432
+ { :noreply , % { state | down: false , graph: graph } , push: graph }
445
433
end
446
434
447
435
# --------------------------------------------------------
@@ -474,10 +462,8 @@ defmodule Scenic.Component.Input.Dropdown do
474
462
# raise the dropdown
475
463
|> Graph . modify ( @ caret_id , & update_opts ( & 1 , rotate: @ rotate_neutral ) )
476
464
|> Graph . modify ( @ dropbox_id , & update_opts ( & 1 , hidden: true ) )
477
- # push to the viewport
478
- |> push_graph ( )
479
465
480
- { :noreply , % { state | down: false , graph: graph , selected_id: item_id } }
466
+ { :noreply , % { state | down: false , graph: graph , selected_id: item_id } , push: graph }
481
467
end
482
468
483
469
# ============================================================================
0 commit comments