Skip to content

Commit

Permalink
Fix floating dropdowns
Browse files Browse the repository at this point in the history
  • Loading branch information
katamatata committed Mar 9, 2023
1 parent 3d4ab05 commit c37920d
Show file tree
Hide file tree
Showing 11 changed files with 40 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ const DeclineMentorshipButton = ({
name="ifDeclinedByMentor_chosenReasonForDecline"
label=""
items={formDeclineOptions}
menuPortalTarget={document.body}
menuPosition="fixed"
formik={formik}
/>
{formik.values.ifDeclinedByMentor_chosenReasonForDecline ===
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@ const MSessions = ({
name="minuteDuration"
placeholder="Add the duration of the session"
items={formMentoringSessionDurationOptions}
menuPortalTarget={document.body}
menuPosition="fixed"
formik={formik}
/>
</form>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -319,12 +319,16 @@ function ModalForm({
multiselect
placeholder="Start typing and select skills"
closeMenuOnSelect={false}
menuPortalTarget={document.body}
menuPosition="fixed"
/>
<FormSelect
label="Employment type*"
name="employmentType"
items={formEmploymentType}
formik={formik}
menuPortalTarget={document.body}
menuPosition="fixed"
/>
<FormInput
name="languageRequirements"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,8 @@ export function JobseekerFormSectionEducation({
name={`education[${index}].startDateMonth`}
label="Started in month*"
items={formMonthsOptions}
menuPortalTarget={document.body}
menuPosition="fixed"
formik={formik}
/>
</Columns.Column>
Expand All @@ -382,6 +384,8 @@ export function JobseekerFormSectionEducation({
name={`education[${index}].endDateMonth`}
label="Ended in month*"
items={formMonthsOptions}
menuPortalTarget={document.body}
menuPosition="fixed"
formik={formik}
/>
</Columns.Column>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,11 +314,15 @@ export function JobseekerFormSectionImportantDetails({
multiselect
placeholder="Select desired employment types"
closeMenuOnSelect={false}
menuPortalTarget={document.body}
menuPosition="fixed"
/>
<FormSelect
label="When are you available to start?*"
name="availability"
items={formAvailabilityOptions}
menuPortalTarget={document.body}
menuPosition="fixed"
formik={formik}
/>
{formik.values.availability === 'date' ? (
Expand All @@ -338,6 +342,8 @@ export function JobseekerFormSectionImportantDetails({
label="What is your immigration status?"
name="immigrationStatus"
items={formImmigrationStatusOptions}
menuPortalTarget={document.body}
menuPosition="fixed"
formik={formik}
/>
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,12 +251,16 @@ export function JobseekerFormSectionLanguages({
name={`workingLanguages[${index}].language`}
label="Language*"
items={formLanguages}
menuPortalTarget={document.body}
menuPosition="fixed"
formik={formik}
/>
<FormSelect
name={`workingLanguages[${index}].proficiencyLevelId`}
label="Level of proficiency*"
items={formLanguageProficiencyLevels}
menuPortalTarget={document.body}
menuPosition="fixed"
formik={formik}
/>
</FormDraggableAccordion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ function ModalForm({
name="federalState"
label="Your place of residence (state)*"
items={federalStatesOptions}
menuPortalTarget={document.body}
menuPosition="fixed"
formik={formik}
/>
<Checkbox.Form
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,16 @@ export function JobseekerFormSectionOverview({
multiselect
placeholder="Start typing and select positions"
closeMenuOnSelect={false}
menuPortalTarget={document.body}
menuPosition="fixed"
/>
{hideCurrentRediCourseField ? null : (
<FormSelect
label="Current ReDI course"
name="currentlyEnrolledInCourse"
items={formCourses}
menuPortalTarget={document.body}
menuPosition="fixed"
formik={formik}
/>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,8 @@ export function JobseekerFormSectionProfessionalExperience({
name={`experience[${index}].startDateMonth`}
label="Started in month*"
items={formMonthsOptions}
menuPortalTarget={document.body}
menuPosition="fixed"
formik={formik}
/>
</Columns.Column>
Expand All @@ -375,6 +377,8 @@ export function JobseekerFormSectionProfessionalExperience({
name={`experience[${index}].endDateMonth`}
label="Ended in month*"
items={formMonthsOptions}
menuPortalTarget={document.body}
menuPosition="fixed"
formik={formik}
/>
</Columns.Column>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,8 @@ export function JobseekerFormSectionSummary({
multiselect
placeholder="Start typing and select skills"
closeMenuOnSelect={false}
menuPortalTarget={document.body}
menuPosition="fixed"
/>
<FormTextArea
label="About you* (100-600 characters)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ interface FormSelectProps {
multiselect?: boolean,
disabled?: boolean,
closeMenuOnSelect?: boolean,
menuPortalTarget?: HTMLElement,
menuPosition?: string,
formik: ReturnType<typeof useFormik>
}

Expand All @@ -50,6 +52,8 @@ function FormSelect(props: FormSelectProps) {
multiselect,
disabled,
closeMenuOnSelect,
menuPortalTarget,
menuPosition,
formik: { values, setFieldTouched, setFieldValue, touched, errors, handleBlur, isSubmitting }
} = props

Expand Down Expand Up @@ -96,8 +100,8 @@ function FormSelect(props: FormSelectProps) {
isDisabled={isSubmitting || disabled}
isMulti={multiselect}
styles={formSelectStyles}
menuPortalTarget={document.body}
menuPosition="fixed"
menuPortalTarget={menuPortalTarget}
menuPosition={menuPosition}
closeMenuOnSelect={closeMenuOnSelect}
/>
</Form.Control>
Expand Down

0 comments on commit c37920d

Please sign in to comment.