Skip to content

Commit

Permalink
Prevent greyout when dragging value with increment
Browse files Browse the repository at this point in the history
Doesn't fully restore the original behavior, but at least prevent
greyouts. Issue has been openen at underlying library in hopes to
support incremental drags again.

rstudio/DT#1123
  • Loading branch information
Jasper Schelfhout committed Jan 31, 2024
1 parent 92a481b commit 6929fd9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions editbl/DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: editbl
Type: Package
Version: 1.0.3
Date: 2024-01-04
Version: 1.0.3-9000
Date: 2024-01-31
Title: 'DT' Extension for CRUD (Create, Read, Update, Delete) Applications in 'shiny'
Authors@R: c(person("Jasper", "Schelfhout", "", "[email protected]",
role = c("aut", "cre")),
Expand Down
6 changes: 3 additions & 3 deletions editbl/R/eDT.R
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ eDTServer <- function(
shiny::removeModal()
})

observeEvent(input$DT_cells_filled, {
observeEvent(input$DT_cells_filled, {
req(!is.null(input$DT_cells_filled) && isTruthy(input$DT_cells_filled))
edits <- input$DT_cells_filled
edits$row <- input$DT_rows_current[edits$row]
Expand Down Expand Up @@ -1256,13 +1256,13 @@ keyTableJS <- c(
autoFillJs <- c(
"var tbl = $(table.table().node());",
"var id = tbl.closest('.datatables').attr('id');",
"table.on('autoFill', function(e, datatable, cells){",
"table.on('preAutoFill', function(e, datatable, cells){",
" var out = [];",
" for(var i = 0; i < cells.length; ++i){",
" var cells_i = cells[i];",
" for(var j = 0; j < cells_i.length; ++j){",
" var c = cells_i[j];",
" var value = c.set === null ? '' : c.set;", # null => problem in R
" var value = (c.set === null || isNaN(c.set))? '' : c.set;", # null => problem in R
" out.push({",
" row: c.index.row + 1,",
" col: c.index.column,",
Expand Down
2 changes: 2 additions & 0 deletions editbl/inst/NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
1.0.3-9000
o Prevent greyout when dragging value with increment. Recently the javascript code of the autofill extension seems to have started returning `NaN` instead of `null`.
1.0.3
o FIX: inputUI argument was not working, now passing on the selected row.
o FIX: Evaluate defaults argument for each new row
Expand Down

0 comments on commit 6929fd9

Please sign in to comment.