|
551 | 551 | }, 100);
|
552 | 552 | }
|
553 | 553 |
|
| 554 | + var currentValue; |
| 555 | + |
| 556 | + function onKeyUp(event) { |
| 557 | + currentValue = priv.editProxy.val(); |
| 558 | + } |
| 559 | + |
554 | 560 | function onKeyDown(event) {
|
555 | 561 | if (selection.isSelected()) {
|
556 | 562 | if ((event.keyCode >= 48 && event.keyCode <= 57) || //0-9
|
|
667 | 673 | }
|
668 | 674 |
|
669 | 675 | function onChange(event) {
|
670 |
| - if(isAutoComplete()) { |
671 |
| - priv.isCellEdited = true; |
672 |
| - editproxy.finishEditing(event); //hide edit field |
673 |
| - selection.transformStart(1, 0); //move selection down |
674 |
| - //editproxy.prepare(priv.selStart); //hide edit field |
| 676 | + if(currentValue !== priv.editProxy.val()) { //do we really have an outside change |
| 677 | + if(isAutoComplete()) { //could this change be from autocomplete |
| 678 | + priv.isCellEdited = true; |
| 679 | + editproxy.finishEditing(event); //save change, hide edit field |
| 680 | + selection.transformStart(1, 0); //move selection down |
| 681 | + } |
675 | 682 | }
|
676 | 683 | }
|
677 | 684 |
|
678 | 685 | priv.editProxy.bind('click', onClick);
|
679 | 686 | priv.editProxy.bind('dblclick', onDblClick);
|
680 | 687 | priv.editProxy.bind('cut', onCut);
|
681 | 688 | priv.editProxy.bind('paste', onPaste);
|
| 689 | + priv.editProxy.bind('keyup', onKeyUp); |
682 | 690 | priv.editProxy.bind('keydown', onKeyDown);
|
683 | 691 | priv.editProxy.bind('change', onChange);
|
684 | 692 | container.append(priv.editProxy);
|
|
0 commit comments