From f384bd4b73fde41f775104b84fe2bf58337827fa Mon Sep 17 00:00:00 2001 From: xusongfu Date: Tue, 13 Dec 2022 16:47:56 +0800 Subject: [PATCH] feature: Add listener input event for instance-volume component 1.If the min attribute is set, the onchange event will not be triggered when the value is lower than min size 2.This is not conducive to our validation of input values, which leads to some unknown bugs Change-Id: Id1ad89fce61681a6e4e96b02ff1a3c804a60ab35 --- src/components/FormItem/InstanceVolume/index.jsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/FormItem/InstanceVolume/index.jsx b/src/components/FormItem/InstanceVolume/index.jsx index 16cbd06f..66e21fec 100644 --- a/src/components/FormItem/InstanceVolume/index.jsx +++ b/src/components/FormItem/InstanceVolume/index.jsx @@ -13,9 +13,8 @@ // limitations under the License. import React from 'react'; -import { Select, Checkbox, Row, Col, Form } from 'antd'; +import { Select, Checkbox, Row, Col, Form, InputNumber } from 'antd'; import PropTypes from 'prop-types'; -import InputInt from '../InputInt'; import styles from './index.less'; export default class InstanceVolume extends React.Component { @@ -152,11 +151,14 @@ export default class InstanceVolume extends React.Component { /> ); const input = ( - `$ ${value}`.replace(/\D/g, '')} + onInput={(e) => this.onInputChange(e * 1)} /> ); const deleteValue = deleteType === 1;