@gm-mobile/c-react 3.9.3-beta.15 → 3.9.3-beta.16

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-mobile/c-react",
3
- "version": "3.9.3-beta.15",
3
+ "version": "3.9.3-beta.16",
4
4
  "description": "> TODO: description",
5
5
  "author": "liyatang <liyatang@qq.com>",
6
6
  "homepage": "https://github.com/gmfe/gm-mobile#readme",
@@ -21,9 +21,9 @@
21
21
  "url": "https://github.com/gmfe/gm-mobile/issues"
22
22
  },
23
23
  "dependencies": {
24
- "@gm-mobile/c-font": "^3.9.3-beta.15",
25
- "@gm-mobile/c-tool": "^3.9.3-beta.15",
26
- "@gm-mobile/locales": "^3.9.3-beta.15"
24
+ "@gm-mobile/c-font": "^3.9.3-beta.16",
25
+ "@gm-mobile/c-tool": "^3.9.3-beta.16",
26
+ "@gm-mobile/locales": "^3.9.3-beta.16"
27
27
  },
28
28
  "peerDependencies": {
29
29
  "@tarojs/components": "3.0.18",
@@ -33,5 +33,5 @@
33
33
  "prop-types": "^15.7.2",
34
34
  "react": "^16.13.1"
35
35
  },
36
- "gitHead": "9b081a91f77cf622b475160581fc8f3398d29c19"
36
+ "gitHead": "7567c11996162bbb506c7fbbfb862f0f9eda1aca"
37
37
  }
@@ -94,9 +94,15 @@ export class TextField extends Component<TextFieldProps, TextFieldState> {
94
94
  !value.endsWith('.') &&
95
95
  ['digit', 'number'].includes(this.props.type || '')
96
96
  ) {
97
+ console.log(value)
97
98
  const float = parseFloat(value.replace(/\D\./g, ''))
98
99
  if (isNaN(float)) {
99
100
  value = ''
101
+ } else if (value.endsWith('.0')) {
102
+ // 处理特殊情况
103
+ if (this.props.fractionDigits === 0) {
104
+ value = value.replace(/\.0$/, '')
105
+ }
100
106
  } else {
101
107
  value = clamp(
102
108
  float,