Skip to content

Commit

Permalink
Merge pull request #680 from Gary-Community-Ventures/bug/screen_overflow
Browse files Browse the repository at this point in the history
Fix Screen Overflow On Mobile Selects
  • Loading branch information
CalebPena authored Nov 3, 2023
2 parents 6b8d26a + 40d68e4 commit fd46c30
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/Components/DropdownMenu/BasicSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const BasicSelect = ({ componentDetails, options, formDataProperty, submitted }:
};

return (
<FormControl sx={{ mt: 1, mb: 2, minWidth: 210 }} error={errorController.showError}>
<FormControl sx={{ mt: 1, mb: 2, minWidth: 210, maxWidth: '100%' }} error={errorController.showError}>
<InputLabel id={labelId}>{inputLabelText}</InputLabel>
<Select
labelId={labelId}
Expand All @@ -96,6 +96,7 @@ const BasicSelect = ({ componentDetails, options, formDataProperty, submitted }:
onChange={(event) => {
handleBasicSelect(event, formDataProperty);
}}
sx={{ maxWidth: '100%' }}
>
{createMenuItems()}
</Select>
Expand Down
3 changes: 2 additions & 1 deletion src/Components/DropdownMenu/DropdownMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const DropdownMenu = ({ componentDetails, options, setHouseholdData, householdDa
};

return (
<FormControl sx={{ mt: 1, minWidth: 210 }} error={errorController.showError}>
<FormControl sx={{ mt: 1, minWidth: 210, maxWidth: '100%' }} error={errorController.showError}>
<InputLabel id={labelId}>{inputLabelText}</InputLabel>
<Select
labelId={labelId}
Expand All @@ -76,6 +76,7 @@ const DropdownMenu = ({ componentDetails, options, setHouseholdData, householdDa
onChange={(event: SelectChangeEvent) => {
handleSelectChange(event);
}}
sx={{ maxWidth: '100%' }}
>
{createMenuItems(options)}
</Select>
Expand Down
3 changes: 2 additions & 1 deletion src/Components/ExpenseBlock/ExpenseQuestion.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import Textfield from '../Textfield/Textfield';

const StyledSelectfield = styled(Select)({
minWidth: 200,
maxWidth: '100%',
});

const StyledDeleteButton = styled(Button)({
Expand Down Expand Up @@ -127,7 +128,7 @@ const ExpenseQuestion = ({ expenseData, allExpensesData, setAllExpenses, deleteE

const createExpenseDropdownMenu = (expenseSourceName, index) => {
return (
<FormControl sx={{ m: 1, minWidth: 120 }} error={expenseTypeErrorController.showError}>
<FormControl sx={{ m: 1, minWidth: 120, maxWidth: '100%' }} error={expenseTypeErrorController.showError}>
<InputLabel id="expense-type-label">
<FormattedMessage
id="expenseBlock.createExpenseDropdownMenu-expenseTypeInputLabel"
Expand Down
5 changes: 3 additions & 2 deletions src/Components/IncomeBlock/IncomeQuestion.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import Textfield from '../Textfield/Textfield';

const StyledSelectfield = styled(Select)({
minWidth: 200,
maxWidth: '100%',
});

const StyledDeleteButton = styled(Button)({
Expand Down Expand Up @@ -156,7 +157,7 @@ const IncomeQuestion = ({

const createIncomeStreamsDropdownMenu = (incomeStreamName, index) => {
return (
<FormControl sx={{ m: 1, minWidth: 120 }} error={incomeStreamErrorController.showError}>
<FormControl sx={{ m: 1, minWidth: 120, maxWidth: '100%' }} error={incomeStreamErrorController.showError}>
<InputLabel id="income-type-label">
<FormattedMessage
id="personIncomeBlock.createIncomeStreamsDropdownMenu-inputLabel"
Expand Down Expand Up @@ -309,7 +310,7 @@ const IncomeQuestion = ({
<FormattedMessage id={formattedMsgId} defaultMessage={formattedMsgDefaultMsg} />
{getIncomeStreamNameLabel(allIncomeSources[index].incomeStreamName)}?
</h2>
<FormControl sx={{ m: 1, minWidth: 120 }} error={incomeFrequencyErrorController.showError}>
<FormControl sx={{ m: 1, minWidth: 120, maxWidth: '100%' }} error={incomeFrequencyErrorController.showError}>
<InputLabel id="income-frequency-label">
<FormattedMessage
id="personIncomeBlock.createIncomeStreamFrequencyDropdownMenu-freqLabel"
Expand Down

0 comments on commit fd46c30

Please sign in to comment.