Permalink
Browse files

Fire change event focused inputs when sorting starts to ensure update…

… in Firefox (#13)
  • Loading branch information...
rniemeyer committed Apr 20, 2012
1 parent 84cfd4c commit e19ff0d62172c55358deca28dae696d66c08eace
Showing with 6 additions and 6 deletions.
  1. +3 −3 build/knockout-sortable.js
  2. +1 −1 build/knockout-sortable.min.js
  3. +2 −2 src/knockout-sortable.js
@@ -8,7 +8,7 @@ var prepareTemplateOptions = function(valueAccessor) {
if (options.data) {
result.foreach = options.data;
result.name = options.template;
- ko.utils.arrayForEach(["afterAdd", "beforeRemove", "afterRender", "includeDestroyed", "templateEngine", "templateOptions"], function (option) {
+ ko.utils.arrayForEach(["afterAdd", "beforeRemove", "includeDestroyed", "templateEngine", "templateOptions"], function (option) {
result[option] = options[option];
});
} else {
@@ -78,8 +78,8 @@ ko.bindingHandlers.sortable = {
setTimeout(function() {
$element.sortable(ko.utils.extend(sortable.options, {
start: function(event, ui) {
- //make sure that fields have a chance to lose focus to update model
- ui.item.filter(':visible').focus();
+ //make sure that fields have a chance to update model
+ ui.item.find("input:focus").change();
if (startActual) {
startActual.apply(this, arguments);
}

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -78,8 +78,8 @@ ko.bindingHandlers.sortable = {
setTimeout(function() {
$element.sortable(ko.utils.extend(sortable.options, {
start: function(event, ui) {
- //make sure that fields have a chance to lose focus to update model
- ui.item.filter(':visible').focus();
+ //make sure that fields have a chance to update model
+ ui.item.find("input:focus").change();
if (startActual) {
startActual.apply(this, arguments);
}

0 comments on commit e19ff0d

Please sign in to comment.