The documentation of the sortable_js_capture_input function states:
This captures the state of a ‘sortable’ list. It will look for an ‘id’ attribute of the first child for each element...
However it appears that the function get_child_id_or_text_js_fn looks for the data-rank-id attribute.
get_child_id_or_text_js_fn <- function() {
paste0(collapse = "\n",
"function(child) {",
" return ",
# use child element attribute 'data-rank-id'
" $(child).attr('data-rank-id') || ",
# otherwise return the inner text of the element
# use inner text vs `.text()` to avoid extra white space
" $.trim(child.innerText);",
"}"
)
}
I'm unsure whether the function or the documentation should be different. Example below.
The documentation of the
sortable_js_capture_input
function states:However it appears that the function
get_child_id_or_text_js_fn
looks for thedata-rank-id
attribute.I'm unsure whether the function or the documentation should be different. Example below.