From 14bc5f49207a1fe8333efc8c4a2eff51c998bac5 Mon Sep 17 00:00:00 2001 From: Avi Sharvit Date: Tue, 25 Aug 2020 16:10:00 +0300 Subject: [PATCH] feat: add inputClassName prop fixes #261 --- README.md | 6 ++++++ src/InputNumber.tsx | 3 ++- src/interface.ts | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1297b659..88250c71 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,12 @@ online example: http://react-component.github.io/input-number/examples/ rc-input-number Specifies the class prefix + + inputClassName + string + + Specifies the class of the html input field + min Number diff --git a/src/InputNumber.tsx b/src/InputNumber.tsx index 25e9fad1..0193156e 100644 --- a/src/InputNumber.tsx +++ b/src/InputNumber.tsx @@ -681,6 +681,7 @@ class InputNumber extends React.Component, InputNumber upHandler, downHandler, className, + inputClassName, max, min, style, @@ -814,7 +815,7 @@ class InputNumber extends React.Component, InputNumber onPaste={onPaste} onClick={onClick} onMouseUp={this.onMouseUp} - className={`${prefixCls}-input`} + className={`${prefixCls}-input ${inputClassName}`} tabIndex={tabIndex} autoComplete={autoComplete} onFocus={this.onFocus} diff --git a/src/interface.ts b/src/interface.ts index bee59356..de645b47 100644 --- a/src/interface.ts +++ b/src/interface.ts @@ -6,6 +6,7 @@ export interface InputNumberProps { prefixCls?: string; style: React.CSSProperties; className?: string; + inputClassName?: string; onKeyUp: (e, ...arg) => void; onKeyDown: (e, ...arg) => void; onMouseUp: (...arg) => void;