浏览代码

Fix CDB editor swallowing key events in Level3D

trethaller 7 年之前
父节点
当前提交
9296a33574
共有 2 个文件被更改,包括 3 次插入0 次删除
  1. 1 0
      hide/comp/cdb/Editor.hx
  2. 2 0
      hide/ui/View.hx

+ 1 - 0
hide/comp/cdb/Editor.hx

@@ -23,6 +23,7 @@ class Editor extends Component {
 		super(root);
 		super(root);
 		this.undo = new hide.ui.UndoHistory();
 		this.undo = new hide.ui.UndoHistory();
 		this.sheet = sheet;
 		this.sheet = sheet;
+		root.attr("tabindex", 0);
 		keys = new hide.ui.Keys(root);
 		keys = new hide.ui.Keys(root);
 		keys.addListener(onKey);
 		keys.addListener(onKey);
 		keys.register("search", function() {
 		keys.register("search", function() {

+ 2 - 0
hide/ui/View.hx

@@ -93,6 +93,8 @@ class View<T> extends hide.comp.Component {
 			return true;
 			return true;
 		}
 		}
 		for( el in root.find("[haskeys=true]").add(root).elements() ) {
 		for( el in root.find("[haskeys=true]").add(root).elements() ) {
+			if(el.has(active).length == 0 && el[0] != active)
+				continue;
 			var keys = hide.ui.Keys.get(el);
 			var keys = hide.ui.Keys.get(el);
 			if( keys == null ) continue;
 			if( keys == null ) continue;
 			if( keys.processEvent(e,props) )
 			if( keys.processEvent(e,props) )