Skip to content

Commit 1c8e768

Browse files
committed
refactor: dashboard sq-text loss blur
1 parent 9c23895 commit 1c8e768

3 files changed

Lines changed: 12 additions & 10 deletions

File tree

frontend/src/stores/dashboard/dashboard.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,11 @@ export const dashboardStore = defineStore('dashboard', {
3838
setFullscreenFlag(val: boolean) {
3939
this.fullscreenFlag = val
4040
},
41-
setCurComponent(value: any) {
41+
setCurComponent: function (value: any) {
42+
if (!value && this.curComponent) {
43+
// @ts-expect-error eslint-disable-next-line @typescript-eslint/ban-ts-comment
44+
this.curComponent.editing = false
45+
}
4246
this.curComponent = value
4347
this.curComponentId = value && value.id ? value.id : null
4448
},

frontend/src/views/dashboard/canvas/CanvasCore.vue

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -735,10 +735,13 @@ function containerMouseDown(e: MouseEvent) {
735735
infoBox.value.startX = e.pageX
736736
infoBox.value.startY = e.pageY
737737
// @ts-expect-error eslint-disable-next-line @typescript-eslint/ban-ts-comment
738-
if (curComponent.value?.component !== 'SQText') {
739-
e.preventDefault()
740-
e.stopPropagation()
741-
}
738+
// if (curComponent.value?.component !== 'SQText') {
739+
// e.preventDefault()
740+
// e.stopPropagation()
741+
// }
742+
743+
e.preventDefault()
744+
e.stopPropagation()
742745
}
743746
744747
function getNowPosition(addSizeX: number, addSizeY: number, moveXSize: number, moveYSize: number) {

frontend/src/views/dashboard/components/sq-text/index.vue

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,6 @@ const init = reactive({
6565
menubar: false,
6666
placeholder: '',
6767
inline: true,
68-
setup: function (editor: any) {
69-
editor.on('blur', function () {
70-
configItem.value.editing = false
71-
})
72-
},
7368
})
7469
7570
const isDisabled = computed(() => props.disabled || !configItem.value.editing)

0 commit comments

Comments
 (0)