Skip to content

Commit f64e848

Browse files
authored
Merge pull request #944 from topcoder-platform/TSJR-217_fix-skills-selector
TSJR-217 fix skills selector -> dev
2 parents adbe492 + 5570417 commit f64e848

File tree

6 files changed

+35
-15
lines changed

6 files changed

+35
-15
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
"react-responsive-modal": "^6.2.0",
9393
"react-router-dom": "^6.4.2",
9494
"react-scripts": "5.0.1",
95-
"react-select": "^5.5.0",
95+
"react-select": "^5.8.0",
9696
"react-spinners": "^0.13.6",
9797
"react-stickynode": "^1.4.1",
9898
"react-toastify": "^9.0.8",

src/apps/onboarding/src/pages/onboarding/index.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import classNames from 'classnames'
55

66
import { routerContext, RouterContextData } from '~/libs/core'
77
import { Member } from '~/apps/talent-search/src/lib/models'
8+
import { SharedSwrConfig } from '~/libs/shared'
89
import { EnvironmentConfig } from '~/config'
910

1011
import { onboardRouteId } from '../../onboarding.routes'
@@ -52,11 +53,13 @@ const OnboardingContent: FC<{
5253
}
5354

5455
export const OnboardingWrapper: FC<{}> = () => (
55-
<div className={classNames(styles.blockWrapper, 'd-flex flex-column align-items-center')}>
56-
<Provider store={store}>
57-
<OnboardingContent />
58-
</Provider>
59-
</div>
56+
<SharedSwrConfig>
57+
<div className={classNames(styles.blockWrapper, 'd-flex flex-column align-items-center')}>
58+
<Provider store={store}>
59+
<OnboardingContent />
60+
</Provider>
61+
</div>
62+
</SharedSwrConfig>
6063
)
6164

6265
export default OnboardingWrapper

src/apps/profiles/src/member-profile/skills/ModifySkillsModal/ModifySkillsModal.module.scss

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@
2828
}
2929

3030
.skillsModalBody {
31-
overflow: visible !important;
31+
:global(.ms--value-container) {
32+
max-height: 90px;
33+
}
3234
}
3335

3436
.principalIntroLink {

src/libs/ui/lib/components/form/form-groups/form-input/input-multiselect/InputMultiselect.module.scss

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,13 +127,14 @@
127127
font-weight: $font-weight-medium;
128128
}
129129
}
130+
}
130131

132+
.ms {
133+
&:global(__menu-portal).ms:global(__menu-portal) {
134+
z-index: 1001;
135+
}
131136
&:global(__menu) {
132-
top: 100%;
133-
left: 0;
134-
position: absolute;
135137
width: 100%;
136-
z-index: 1;
137138
background-color: $tc-white;
138139
border-radius: 4px;
139140
box-shadow: 0px 4px 4px 0px rgba(0,0,0,0.25);

src/libs/ui/lib/components/form/form-groups/form-input/input-multiselect/InputMultiselect.tsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,18 @@ const dropdownIndicator = (dropdownIcon: ReactNode): FC => (props: any) => (
8484
)
8585

8686
const InputMultiselect: FC<InputMultiselectProps> = props => {
87+
// we need to create a portal to append our menus so they are always visible
88+
const menuPortalTarget = useMemo(() => {
89+
const el = document.getElementById('input-ms-menu-target-portal') ?? document.createElement('div')
90+
el.id = 'input-ms-menu-target-portal'
91+
92+
if (!document.body.contains(el)) {
93+
document.body.append(el)
94+
}
95+
96+
return el
97+
}, [])
98+
8799
const asynSelectRef = useRef<any>()
88100
const placeholder = useMemo(() => (
89101
(props.value?.length as number) > 0 ? props.additionalPlaceholder ?? 'Add more...' : props.placeholder
@@ -132,6 +144,7 @@ const InputMultiselect: FC<InputMultiselectProps> = props => {
132144
props.useWrapper === false && styles.multiSelectWrap,
133145
)
134146
}
147+
classNames={{ valueContainer: () => 'ms--value-container' }}
135148
ref={props.inputRef ?? asynSelectRef}
136149
classNamePrefix={styles.ms}
137150
unstyled
@@ -156,6 +169,7 @@ const InputMultiselect: FC<InputMultiselectProps> = props => {
156169
openMenuOnClick={false}
157170
onKeyDown={handleKeyPress}
158171
filterOption={props.filterOption}
172+
menuPortalTarget={menuPortalTarget}
159173
/>
160174
)
161175

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16417,10 +16417,10 @@ react-scripts@5.0.1:
1641716417
optionalDependencies:
1641816418
fsevents "^2.3.2"
1641916419

16420-
react-select@^5.5.0:
16421-
version "5.7.0"
16422-
resolved "https://registry.yarnpkg.com/react-select/-/react-select-5.7.0.tgz#82921b38f1fcf1471a0b62304da01f2896cd8ce6"
16423-
integrity sha512-lJGiMxCa3cqnUr2Jjtg9YHsaytiZqeNOKeibv6WF5zbK/fPegZ1hg3y/9P1RZVLhqBTs0PfqQLKuAACednYGhQ==
16420+
react-select@^5.8.0:
16421+
version "5.8.0"
16422+
resolved "https://registry.yarnpkg.com/react-select/-/react-select-5.8.0.tgz#bd5c467a4df223f079dd720be9498076a3f085b5"
16423+
integrity sha512-TfjLDo58XrhP6VG5M/Mi56Us0Yt8X7xD6cDybC7yoRMUNm7BGO7qk8J0TLQOua/prb8vUOtsfnXZwfm30HGsAA==
1642416424
dependencies:
1642516425
"@babel/runtime" "^7.12.0"
1642616426
"@emotion/cache" "^11.4.0"

0 commit comments

Comments
 (0)