Browse Source

fix: text field 定位问题

liutian 1 year ago
parent
commit
d81882ef5f

+ 3 - 0
packages/core/src/form/text_field.js

@@ -885,6 +885,7 @@ export default class TextField extends Base {
       textContainer = createElement(
         'textarea',
         {
+          position: 'absolute',
           width: '100%',
           height: '100%',
           outline: 'none',
@@ -894,6 +895,7 @@ export default class TextField extends Base {
           pointerEvents: 'none',
           cursor: 'pointer',
           resize: 'none',
+          overflowWrap: 'break-word',
           textAlign: this.annotation.textAlignment,
           fontSize: this.annotation.fontSize + 'px',
           fontWeight: this.annotation.isBold ? 'bold' : 'normal',
@@ -906,6 +908,7 @@ export default class TextField extends Base {
       textContainer = createElement(
         'input',
         {
+          position: 'absolute',
           width: '100%',
           height: '100%',
           outline: 'none',

+ 1 - 1
packages/webview/src/components/Outlines/Outlines.vue

@@ -13,7 +13,7 @@
 </template>
 
 <script setup>
-import { ref, computed, defineEmits } from 'vue'
+import { ref, computed } from 'vue'
 import { useDocumentStore } from '@/stores/modules/document'
 
 const emits = defineEmits()