From ecc36a86c4e101881cb12989d5c4f13cca25ad68 Mon Sep 17 00:00:00 2001 From: Thomas Kranitsas Date: Fri, 29 Dec 2017 21:59:18 +0200 Subject: [PATCH 1/2] Fix text area auto-sizing --- src/projects/detail/components/EditProjectForm.jsx | 13 +++++++++++-- src/projects/detail/components/SpecSection.jsx | 3 +-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/projects/detail/components/EditProjectForm.jsx b/src/projects/detail/components/EditProjectForm.jsx index ffa9a1133..70a9913df 100644 --- a/src/projects/detail/components/EditProjectForm.jsx +++ b/src/projects/detail/components/EditProjectForm.jsx @@ -100,6 +100,14 @@ class EditProjectForm extends Component { window.addEventListener('beforeunload', this.onLeave) } + autoResize() { + if (self.autoResizeSet === true) { return } + self.autoResizeSet = true + setTimeout(() => { + window.dispatchEvent(new Event('resize')) + }, 1000) + } + componentWillUnmount() { this.props.fireProjectDirtyUndo() window.removeEventListener('beforeunload', this.onLeave) @@ -107,8 +115,9 @@ class EditProjectForm extends Component { // Notify user if they navigate away while the form is modified. onLeave(e = {}) { + this.autoResize() if (this.isChanged()) { - // TODO: remove this block - it disables unsaved changes popup + // TODO: remove this block - it disables unsaved changes popup // for app screens changes if (this.refs.form){ const pristine = this.refs.form.getPristineValues() @@ -237,7 +246,7 @@ class EditProjectForm extends Component { value={ _.get(project, 'details.appDefinition.features', {})} /> - + ) } diff --git a/src/projects/detail/components/SpecSection.jsx b/src/projects/detail/components/SpecSection.jsx index bf1fc0576..1d6b78b7a 100644 --- a/src/projects/detail/components/SpecSection.jsx +++ b/src/projects/detail/components/SpecSection.jsx @@ -28,7 +28,7 @@ const SpecSection = props => { !subSection.hideTitle &&

- {typeof subSection.title === 'function' ? subSection.title(project): subSection.title } + {typeof subSection.title === 'function' ? subSection.title(project): subSection.title } {((typeof subSection.required === 'function') ? subSection.required(project, subSections) : subSection.required) ? '*' : ''}

@@ -75,7 +75,6 @@ const SpecSection = props => { {props.description} From 0e97e28872769399460b337ed6138ccf5cbf9a5a Mon Sep 17 00:00:00 2001 From: Thomas Kranitsas Date: Mon, 1 Jan 2018 21:45:47 +0200 Subject: [PATCH 2/2] Fix auto-resize issue in textbox --- .../detail/components/SpecQuestionList/SpecQuestionList.scss | 2 +- src/projects/detail/components/SpecSection.jsx | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/projects/detail/components/SpecQuestionList/SpecQuestionList.scss b/src/projects/detail/components/SpecQuestionList/SpecQuestionList.scss index 54d0b9ca0..77eb9287c 100644 --- a/src/projects/detail/components/SpecQuestionList/SpecQuestionList.scss +++ b/src/projects/detail/components/SpecQuestionList/SpecQuestionList.scss @@ -75,7 +75,7 @@ text-align: left; text-indent: 0; margin-bottom: 0; - line-height: 25px; + line-height: 24.5px; } .radio-group-input, diff --git a/src/projects/detail/components/SpecSection.jsx b/src/projects/detail/components/SpecSection.jsx index 1d6b78b7a..173fdf3bc 100644 --- a/src/projects/detail/components/SpecSection.jsx +++ b/src/projects/detail/components/SpecSection.jsx @@ -75,6 +75,7 @@ const SpecSection = props => { {props.description}