This is particularly troubling if/when a Shiny app's sortable input has been emptied. This message only goes back to the server side if/when there is at least one element in the list. (i.e. mapping over an empty array / no children means no function firing and no update to the server side).
Perhaps we could even make the callback configurable here (add a parameter "child_node_callback" or someting) that defaults to the current behavior.
EDIT: Although... this may just be a problem with observeEvent(input$my_input, {}). Yeah, because an empty list is getting sent back to R, which is what we expect. So it is just observeEvent not firing on the NULL that is confusing me.
https://github.com/rstudio/sortable/blob/ef56c4c0ae2a7eef4063132c83f3a0f257abe568/R/sortable_js_capture_input.R#L14-L17
This is particularly troubling if/when a Shiny app's sortable input has been emptied. This message only goes back to the server side if/when there is at least one element in the list. (i.e. mapping over an empty array / no children means no function firing and no update to the server side).
Perhaps we could even make the callback configurable here (add a parameter "child_node_callback" or someting) that defaults to the current behavior.
EDIT: Although... this may just be a problem with
observeEvent(input$my_input, {})
. Yeah, because an empty list is getting sent back to R, which is what we expect. So it is justobserveEvent
not firing on the NULL that is confusing me.