Przeglądaj źródła

编辑器-导航:分组组件优化交互

任一存 3 lat temu
rodzic
commit
795c6e9adb

+ 8 - 2
packages/code/src/components/sceneGroupInEditor.vue

@@ -58,12 +58,16 @@
           </div>
         </div>
       </template>
-      <input v-if="isRenaming" class="group-title-input" v-model="newName"
+      <input
+        v-if="isRenaming"
+        class="group-title-input"
+        v-model="newName"
         ref="input-for-rename"
         maxlength="50"
         placeholder="输入名字"
         @blur="onInputNewNameComplete"
         @keydown.enter="onInputEnter"
+        @click.stop
       />
     </div>
 
@@ -201,7 +205,9 @@ export default {
     },
     onInputNewNameComplete() {
       this.isRenaming = false
-      this.$emit('renameGroup', this.groupNode.id, this.level, this.newName)
+      if (this.newName !== this.groupNode.name) {
+        this.$emit('renameGroup', this.groupNode.id, this.level, this.newName)
+      }
       this.newName = ''
     },
     onInputEnter() {