From 753879e6bf4ab265acd7d12424ba92908917c374 Mon Sep 17 00:00:00 2001 From: Waleed065 <65929645+Waleed065@users.noreply.github.com> Date: Tue, 24 Aug 2021 23:16:03 +0500 Subject: [PATCH] Update index.js --- src/index.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/index.js b/src/index.js index 55aaa7f..e20e68d 100644 --- a/src/index.js +++ b/src/index.js @@ -19,7 +19,10 @@ export default class ReactCodeInput extends Component { fields: PropTypes.number, loading: PropTypes.bool, title: PropTypes.string, - fieldWidth: PropTypes.number, + fieldWidth: PropTypes.oneOfType([ + PropTypes.string, + PropTypes.number + ]), id: PropTypes.string, fieldHeight: PropTypes.number, autoFocus: PropTypes.bool, @@ -204,7 +207,7 @@ export default class ReactCodeInput extends Component { height: fieldHeight }; const ROOT_STYLE = { - width: fields * fieldWidth + width: (fields * fieldWidth) || "auto" }; const LOADING_STYLE = { lineHeight: `${fieldHeight}px`