Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions R/datatables.R
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
7 changes: 4 additions & 3 deletions inst/htmlwidgets/datatables.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = $('<input type="text">'), changed = false;
var $divInput = $('<div class="form-group row" style="margin-bottom:auto;"><input type="text" class="form-control form-control-sm" size="1"></div>');
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');
Expand All @@ -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;
Expand Down