Quellcode durchsuchen

Fix shift + enter crashing on text cells

Leonardo Jeanteur vor 3 Jahren
Ursprung
Commit
6859d3286e
1 geänderte Dateien mit 5 neuen und 2 gelöschten Zeilen
  1. 5 2
      hide/comp/cdb/Cell.hx

+ 5 - 2
hide/comp/cdb/Cell.hx

@@ -155,6 +155,9 @@ class Cell extends Component {
 
 
 	public function refresh(withSubtable = false) {
 	public function refresh(withSubtable = false) {
 		currentValue = Reflect.field(line.obj, column.name);
 		currentValue = Reflect.field(line.obj, column.name);
+
+		blurOff = true;
+
 		var html = valueHtml(column, value, line.table.getRealSheet(), line.obj, []);
 		var html = valueHtml(column, value, line.table.getRealSheet(), line.obj, []);
 		if( !R_HTML.match(html) )
 		if( !R_HTML.match(html) )
 			element[0].textContent = html;
 			element[0].textContent = html;
@@ -162,6 +165,8 @@ class Cell extends Component {
 			element.html(html);
 			element.html(html);
 		else
 		else
 			element[0].innerHTML = html;
 			element[0].innerHTML = html;
+		blurOff = false;
+
 		updateClasses();
 		updateClasses();
 		var subTable = line.subTable;
 		var subTable = line.subTable;
 		if( withSubtable && subTable != null && subTable.cell == this) {
 		if( withSubtable && subTable != null && subTable.cell == this) {
@@ -170,7 +175,6 @@ class Cell extends Component {
 			else
 			else
 				table.refreshList(this);
 				table.refreshList(this);
 		}
 		}
-		blurOff = false;
 	}
 	}
 
 
 	function watchFile( file : String ) {
 	function watchFile( file : String ) {
@@ -579,7 +583,6 @@ class Cell extends Component {
 			i.keydown(function(e) {
 			i.keydown(function(e) {
 				switch( e.keyCode ) {
 				switch( e.keyCode ) {
 				case K.ESCAPE:
 				case K.ESCAPE:
-					blurOff = true;
 					refresh();
 					refresh();
 					table.editor.element.focus();
 					table.editor.element.focus();
 				case K.ENTER if( !e.shiftKey || !column.type.match(TString|TDynamic|TCustom(_)) ):
 				case K.ENTER if( !e.shiftKey || !column.type.match(TString|TDynamic|TCustom(_)) ):