Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: the position of the pop-up window for configuring internationalized entries in the editor is incorrect when the full screen is switched #969

Open
wants to merge 1 commit into
base: refactor/develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions packages/common/component/MonacoEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
:options="editorOptions"
language="javascript"
@editorDidMount="$emit('editorDidMount', $event)"
@change="$emit('change', $event)"
@shortcutSave="$emit('shortcutSave', $event)"
></monaco-editor>
</div>
<slot v-if="fullscreen" name="fullscreenFooter"></slot>
Expand Down Expand Up @@ -60,8 +62,8 @@ export default {
default: true
}
},
emits: ['editorDidMount'],
setup(props) {
emits: ['editorDidMount', 'change', 'shortcutSave', 'fullscreenChange'],
setup(props, { emit }) {
const editor = ref(null)
const fullscreen = ref(false)
const editorOptions = computed(() => {
Expand Down Expand Up @@ -112,6 +114,7 @@ export default {

const switchFullScreen = (value) => {
fullscreen.value = value
emit('fullscreenChange', value)
}

return {
Expand Down
6 changes: 6 additions & 0 deletions packages/plugins/state/src/CreateVariable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
:showFormatBtn="true"
:options="state.editorOptions"
@editorDidMount="editorDidMount"
@fullscreenChange="fullscreenChange"
>
<template #buttons>
<editor-i18n-tool ref="i18nToolRef" @confirm="insertContent"></editor-i18n-tool>
Expand Down Expand Up @@ -340,6 +341,10 @@ export default {
}
}

const fullscreenChange = () => {
i18nToolRef.value.state.showPopover = false
}

onBeforeUnmount(() => {
state.completionProvider?.forEach((provider) => {
provider.dispose()
Expand Down Expand Up @@ -398,6 +403,7 @@ export default {
validate,
getFormData,
insertContent,
fullscreenChange,
cancel
}
}
Expand Down
Loading