@gm-pc/keyboard 1.14.0-alpha.0 → 1.14.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gm-pc/keyboard",
3
- "version": "1.14.0-alpha.0",
3
+ "version": "1.14.0-alpha.1",
4
4
  "description": "",
5
5
  "author": "liyatang <liyatang@qq.com>",
6
6
  "homepage": "https://github.com/gmfe/gm-pc#readme",
@@ -27,10 +27,10 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "@gm-common/tool": "^2.10.0",
30
- "@gm-pc/react": "^1.14.0-alpha.0",
31
- "@gm-pc/table-x": "^1.14.0-alpha.0",
30
+ "@gm-pc/react": "^1.14.0-alpha.1",
31
+ "@gm-pc/table-x": "^1.14.0-alpha.1",
32
32
  "classnames": "^2.2.5",
33
33
  "lodash": "^4.17.19"
34
34
  },
35
- "gitHead": "68355f8611699df931fb04ab0fbfc5501d6392ae"
35
+ "gitHead": "b8a3ea89e8e45c98d6706b52ca05c6f4bf4bef68"
36
36
  }
@@ -35,11 +35,14 @@ const KCInputNumber: ForwardRefRenderFunction<RefFunctionProps, InputNumberProps
35
35
  }
36
36
 
37
37
  const handleInputFocus = (event: FocusEvent<HTMLInputElement>) => {
38
+ event.persist()
38
39
  if (onFocus) {
39
40
  onFocus(event)
40
41
  return
41
42
  }
42
- event.target && event.target.select()
43
+ setTimeout(() => {
44
+ event.target && event.target.select()
45
+ })
43
46
  }
44
47
 
45
48
  const handleKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {
@@ -76,17 +76,28 @@ function keyboardTableXHOC<Props extends TableXProps = TableXProps>(
76
76
  // fix hoc 带来的问题
77
77
  let leftFixedWidth = 0
78
78
  let rightFixedWidth = 0
79
- useMemo(() => {
80
- columns.forEach((column: KeyboardTableXColumn) => {
81
- if (column.show !== false) {
82
- if (column.fixed === 'left' && column.width) {
83
- leftFixedWidth += column.width as number
84
- } else if (column.fixed === 'right' && column.width) {
85
- rightFixedWidth += column.width as number
86
- }
79
+ // useMemo(() => {
80
+ // columns.forEach((column: KeyboardTableXColumn) => {
81
+ // if (column.show !== false) {
82
+ // if (column.fixed === 'left' && column.width) {
83
+ // leftFixedWidth += column.width as number
84
+ // } else if (column.fixed === 'right' && column.width) {
85
+ // rightFixedWidth += column.width as number
86
+ // }
87
+ // }
88
+ // })
89
+ // }, [columns])
90
+
91
+ // 这里缓存的话,会导致keyboardleft时滚动条无法跟随焦点走
92
+ columns.forEach((column: KeyboardTableXColumn) => {
93
+ if (column.show !== false) {
94
+ if (column.fixed === 'left' && column.width) {
95
+ leftFixedWidth += column.width as number
96
+ } else if (column.fixed === 'right' && column.width) {
97
+ rightFixedWidth += column.width as number
87
98
  }
88
- })
89
- }, [columns])
99
+ }
100
+ })
90
101
 
91
102
  return (
92
103
  <Wrap