From 112a493d14a7928d3d02724233d548b1fb9785b7 Mon Sep 17 00:00:00 2001 From: Ian Gulliver Date: Tue, 25 Jun 2019 19:06:00 +0000 Subject: [PATCH] Don't draw focus based on missing group/link labels. --- architype.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/architype.js b/architype.js index 83b24b4..1392ae6 100644 --- a/architype.js +++ b/architype.js @@ -523,6 +523,10 @@ class EditorEntryBase extends ListenUtils { clear() { } + wantFocus() { + return false; + } + onElemFocus() { this.elem_.scrollIntoView({block: 'center'}); } @@ -607,6 +611,10 @@ class Node extends EditorEntryBase { return this.elem_; } + wantFocus() { + return this.getLabel() == ''; + } + isSoft() { // Nested nodes are presumed to be references to other nodes if they exist let iter = this.elem_.parentElement; @@ -629,7 +637,7 @@ class Node extends EditorEntryBase { e.preventDefault(); if (this.elem_.nextElementSibling && this.elem_.nextElementSibling.xArchObj && - this.elem_.nextElementSibling.xArchObj.getLabel() == '') { + this.elem_.nextElementSibling.xArchObj.wantFocus()) { this.elem_.nextElementSibling.xArchObj.startEdit(); } else { this.stopEdit();