Browse Source

Merge remote-tracking branch 'origin/master'

luoyifan 3 years ago
parent
commit
f630243eb5
2 changed files with 15 additions and 6 deletions
  1. 11 5
      src/controls/input/textfield.js
  2. 4 1
      src/lib/systemLib.ts

+ 11 - 5
src/controls/input/textfield.js

@@ -1,6 +1,6 @@
 import _ from 'lodash'
-import {baseConfig} from "../base";
-import {text} from "../../Defaults";
+import {baseConfig} from "../base"
+import {text} from "../../Defaults"
 import {
     PropertyDescriptionTable,
     YvBase,
@@ -12,8 +12,9 @@ import {
     metaId,
     width,
     height
-} from "../../PropertyDescriptionTable";
-import {PropertyDescription} from "../../PropertyDescription";
+} from "../../PropertyDescriptionTable"
+import $ from 'jquery'
+import {PropertyDescription} from "../../PropertyDescription"
 
 export default function () {
 
@@ -79,7 +80,12 @@ export default function () {
                     }
                 },
                 afterrender(sender) {
-                    sender.inputEl.dom.setAttribute('spellcheck', "false");
+                    if(sender.inputEl?.dom) {
+                        sender.inputEl.dom.setAttribute('spellcheck', "false");
+                        $(sender.inputEl.dom).on('click', (e)=>{
+                            sender.fireEvent('click', this, e)
+                        })
+                    }
                 }
             })
 

+ 4 - 1
src/lib/systemLib.ts

@@ -111,7 +111,10 @@ export function calcObjectFlat(data, paramObject) {
  * 合併 data 到當前的 ViewModel 對象
  */
 export function mergeViewModel(viewModel, propertyName, data) {
-    _.forOwn(flatRow(data), (value, key) => {
+    const newRow = {}
+    flatObject(newRow, '', data)
+
+    _.forOwn(newRow, (value, key) => {
         viewModel.set(propertyName + "." + key, value)
     })
 }