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

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",
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",
31
+ "@gm-pc/table-x": "^1.14.0",
32
32
  "classnames": "^2.2.5",
33
33
  "lodash": "^4.17.19"
34
34
  },
35
- "gitHead": "68355f8611699df931fb04ab0fbfc5501d6392ae"
35
+ "gitHead": "df6a59ce4c2146ba8267b47a66d4048298c671e2"
36
36
  }
@@ -31,7 +31,7 @@ const KCInputNumber: ForwardRefRenderFunction<RefFunctionProps, InputNumberProps
31
31
 
32
32
  const handleFocus = () => {
33
33
  // eslint-disable-next-line
34
- targetRef.current?.apiDoFocus()
34
+ targetRef.current?.apiDoSelect()
35
35
  }
36
36
 
37
37
  const handleInputFocus = (event: FocusEvent<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