Skip to content

Commit

Permalink
Merge pull request #353 from saksham-malhotra-27/feat-341-customtextf…
Browse files Browse the repository at this point in the history
…ield-fullWidth-issue-solved

Fix #341 : Update CustomTextField for full-width support
  • Loading branch information
erenfn authored Dec 17, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents 223e02f + cdc3e59 commit 6c2f98b
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -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 (
<div style={style}>
<div style={{...style, ...(computedFullWidth && { width: '100%' })}} >
{!checkCircleIconVisible &&
<div>
<InputLabel sx={{ fontWeight: labelFontWeight, margin: 0 }}>{labelText}</InputLabel>
@@ -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,
};

0 comments on commit 6c2f98b

Please sign in to comment.