1
0
mirror of https://github.com/DataTables/DataTables.git synced 2025-02-18 16:54:14 +01:00

Fix: If the user is currently focused on the filtering input element, don't overwrite the value that is already shown as this will effect the cursor position.

This commit is contained in:
Allan Jardine 2012-09-16 12:00:36 +01:00
parent a19e1dee12
commit d1142e1450
2 changed files with 8 additions and 2 deletions

View File

@ -5622,7 +5622,10 @@
var n = oSettings.aanFeatures.f;
for ( var i=0, iLen=n.length ; i<iLen ; i++ )
{
$(n[i]._DT_Input).val( sInput );
if ( n[i]._DT_Input != document.activeElement )
{
$(n[i]._DT_Input).val( sInput );
}
}
}
}

View File

@ -683,7 +683,10 @@ this.fnFilter = function( sInput, iColumn, bRegex, bSmart, bShowGlobal, bCaseIns
var n = oSettings.aanFeatures.f;
for ( var i=0, iLen=n.length ; i<iLen ; i++ )
{
$(n[i]._DT_Input).val( sInput );
if ( n[i]._DT_Input != document.activeElement )
{
$(n[i]._DT_Input).val( sInput );
}
}
}
}