Skip to content

Commit

Permalink
#205 changed way of setting rows for textarea
Browse files Browse the repository at this point in the history
  • Loading branch information
matej-vavrek committed Mar 20, 2020
1 parent d783715 commit 95579c3
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions js/components/userFeedback/reportForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const useStyles = makeStyles(theme => ({
minWidth: '256px'
},
description: {
minHeight: '270px'
minHeight: '245px'
},
body: {
width: '100%',
Expand Down Expand Up @@ -243,6 +243,10 @@ export const ReportForm = memo(({ formType }) => {
return text;
};

const getTextAreaRows = rows => {
return isFirefox() ? rows - 1 : rows;
};

return (
<div>
<Button
Expand Down Expand Up @@ -343,7 +347,7 @@ export const ReportForm = memo(({ formType }) => {
name="title"
label="Subject"
multiline
rows="2"
rows={getTextAreaRows(3)}
value={formState.title}
onInput={e => dispatch(setTitle(e.target.value))}
disabled={isSubmitting}
Expand All @@ -357,7 +361,7 @@ export const ReportForm = memo(({ formType }) => {
label="Description"
placeholder="Describe your problem in a detail."
multiline
rows="6"
rows={getTextAreaRows(12)}
value={formState.description}
onInput={e => dispatch(setDescription(e.target.value))}
disabled={isSubmitting}
Expand Down

0 comments on commit 95579c3

Please sign in to comment.