diff --git a/R/datatables.R b/R/datatables.R index ab6503b0..26c1b043 100644 --- a/R/datatables.R +++ b/R/datatables.R @@ -527,16 +527,16 @@ filterRow = function( style = 'margin-bottom: auto;', tags$input( type = if (clear) 'search' else 'text', placeholder = 'All', - style = 'width: 100%;' + style = 'width: 100%;', size = "1" ) ) } else { tags$div( - class = if (clear) 'form-group has-feedback' else 'form-group', + class = if (clear) 'form-group has-feedback row' else 'form-group row', style = 'margin-bottom: auto;', tags$input( - type = 'search', placeholder = 'All', class = 'form-control', - style = 'width: 100%;' + type = 'search', placeholder = 'All', class = 'form-control input-sm', + style = 'width: 100%; padding-right: 0px;', size = "1" ), if (clear) tags$span( class = 'glyphicon glyphicon-remove-circle form-control-feedback' diff --git a/inst/htmlwidgets/datatables.js b/inst/htmlwidgets/datatables.js index 1053375f..94c79727 100644 --- a/inst/htmlwidgets/datatables.js +++ b/inst/htmlwidgets/datatables.js @@ -754,7 +754,8 @@ HTMLWidgets.widget({ (function(cell, current) { var $cell = $(cell), html = $cell.html(); var _cell = table.cell(cell), value = _cell.data(); - var $input = $(''), changed = false; + var $divInput = $('
'); + var $input = $divInput.children("input"), changed = false; if (!immediate) { $cell.data('input', $input).data('html', html); $input.attr('title', 'Hit Ctrl+Enter to finish editing, or Esc to cancel'); @@ -763,9 +764,9 @@ HTMLWidgets.widget({ if (inArray(_cell.index().column, disableCols)) { $input.attr('readonly', '').css('filter', 'invert(25%)'); } - $cell.empty().append($input); + $cell.empty().append($divInput); if (cell === current) $input.focus(); - $input.css('width', '100%'); + $input.css('width', '100%').css('padding-right', '0px'); if (immediate) $input.on('change', function() { changed = true;