move select value from option to select
refs LS-3017 flag=none test plan: - tests pass qa risk: low Change-Id: Ia52680b0e2b5c277f6078ea19737c7107985abfb Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/286069 Reviewed-by: Ahmad Amireh <ahmad@instructure.com> Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> QA-Review: Omar Soto-Fortuño <omar.soto@instructure.com> Product-Review: Omar Soto-Fortuño <omar.soto@instructure.com>
This commit is contained in:
parent
afac4e90a0
commit
bbe2edc991
|
@ -85,7 +85,6 @@ const ignoredErrors = [
|
|||
/The prop `renderLabel` is marked as required in `(FileDrop|NumberInput|Select)`/,
|
||||
/The prop `rootId` is marked as required in `GroupSelectionDrillDown`/,
|
||||
/Unexpected keys "searchPermissions", "filterRoles", "tabChanged", "setAndOpenAddTray" found in preloadedState argument passed to createStore/,
|
||||
/Use the `defaultValue` or `value` props on <select> instead of setting `selected` on <option>/,
|
||||
/validateDOMNesting\(...\): %s cannot appear as a child of <%s>/,
|
||||
/WARNING: heuristic fragment matching going on!/,
|
||||
/Warning: Failed prop type: Expected one of Checkbox in CheckboxGroup but found `View`/,
|
||||
|
|
|
@ -82,7 +82,7 @@ class TeacherFeedbackForm extends React.Component {
|
|||
const value = `course_${c.id}_admins`
|
||||
|
||||
return (
|
||||
<option key={value} value={value} selected={window.ENV.context_id == c.id}>
|
||||
<option key={value} value={value}>
|
||||
{c.name}
|
||||
</option>
|
||||
)
|
||||
|
@ -96,6 +96,10 @@ class TeacherFeedbackForm extends React.Component {
|
|||
}
|
||||
|
||||
render() {
|
||||
const selectedCourse = this.state.courses
|
||||
.filter(c => !c.access_restricted_by_date)
|
||||
.find(c => c.id === window.ENV.context_id)
|
||||
const currentSelectValue = selectedCourse ? `course_${selectedCourse.id}_admins` : null
|
||||
return (
|
||||
<form ref={c => (this.form = c)} action="/api/v1/conversations" method="POST">
|
||||
<fieldset className="ic-Form-group ic-HelpDialog__form-fieldset">
|
||||
|
@ -108,6 +112,7 @@ class TeacherFeedbackForm extends React.Component {
|
|||
required
|
||||
aria-required="true"
|
||||
name="recipients[]"
|
||||
value={currentSelectValue}
|
||||
>
|
||||
{this.renderCourseOptions()}
|
||||
</select>
|
||||
|
|
Loading…
Reference in New Issue