diff --git a/frontend/src/components/TextFieldComponents/CustomTextField/CustomTextField.jsx b/frontend/src/components/TextFieldComponents/CustomTextField/CustomTextField.jsx index 6e1f2bc3..f15e89fb 100644 --- a/frontend/src/components/TextFieldComponents/CustomTextField/CustomTextField.jsx +++ b/frontend/src/components/TextFieldComponents/CustomTextField/CustomTextField.jsx @@ -30,11 +30,14 @@ const CustomTextField = ({ required = false, style, labelSubText, + fullWidth=false, disabled = false, autofocus = false }) => { + const computedFullWidth = fullWidth || + ["full", "100%", "stretch"].some(value => TextFieldWidth.toLowerCase().includes(value)); return ( -
+
{!checkCircleIconVisible &&
{labelText} @@ -56,8 +59,8 @@ const CustomTextField = ({ onBlur={onBlur} required={Boolean(required)} className="textField" - sx={{ width: TextFieldWidth }} - fullWidth + sx={{ width: computedFullWidth ? "100%" : TextFieldWidth }} + fullWidth={computedFullWidth} margin={textFieldMargin} value={value} onChange={onChange} @@ -118,6 +121,7 @@ CustomTextField.propTypes = { displayCheckCircleIcon: PropTypes.bool, textFieldMargin: PropTypes.string, type: PropTypes.string, + fullWidth: PropTypes.bool, required: PropTypes.bool, };