Fix select styles

Signed-off-by: soupette <cyril.lpz@gmail.com>
This commit is contained in:
soupette 2020-07-03 16:50:17 +02:00 committed by Alexandre Bodin
parent 842f78d5fe
commit b847ffff52
3 changed files with 14 additions and 0 deletions

View File

@ -52,6 +52,7 @@ const selectStyle = {
} = state; } = state;
let border; let border;
let borderBottom;
if (state.isFocused) { if (state.isFocused) {
border = '1px solid #78caff !important'; border = '1px solid #78caff !important';
@ -61,6 +62,10 @@ const selectStyle = {
border = '1px solid #e3e9f3 !important'; border = '1px solid #e3e9f3 !important';
} }
if (state.menuIsOpen === true) {
borderBottom = '1px solid #e3e9f3 !important';
}
return { return {
...base, ...base,
fontSize: 13, fontSize: 13,
@ -70,6 +75,7 @@ const selectStyle = {
boxShadow: 0, boxShadow: 0,
borderRadius: '2px !important', borderRadius: '2px !important',
...borderRadiusStyle, ...borderRadiusStyle,
borderBottom,
}; };
}, },
valueContainer: base => ({ valueContainer: base => ({

View File

@ -15,6 +15,7 @@ const styles = {
} = state; } = state;
let border; let border;
let borderBottom;
if (state.isFocused) { if (state.isFocused) {
border = '1px solid #78caff !important'; border = '1px solid #78caff !important';
@ -24,6 +25,10 @@ const styles = {
border = '1px solid #e3e9f3 !important'; border = '1px solid #e3e9f3 !important';
} }
if (state.menuIsOpen === true) {
borderBottom = '1px solid #e3e9f3 !important';
}
return { return {
...base, ...base,
fontSize: 13, fontSize: 13,
@ -33,6 +38,7 @@ const styles = {
boxShadow: 0, boxShadow: 0,
borderRadius: '2px !important', borderRadius: '2px !important',
...borderRadiusStyle, ...borderRadiusStyle,
borderBottom,
}; };
}, },
menu: base => { menu: base => {
@ -53,6 +59,7 @@ const styles = {
menuList: base => ({ menuList: base => ({
...base, ...base,
maxHeight: '112px', maxHeight: '112px',
paddingTop: 2,
}), }),
option: (base, state) => { option: (base, state) => {
return { return {

View File

@ -204,6 +204,7 @@ describe('ADMIN | COMPONENTS | USER | SelectRoles | utils | styles', () => {
const expected = { const expected = {
ok: true, ok: true,
maxHeight: '112px', maxHeight: '112px',
paddingTop: 2,
}; };
expect(styles.menuList(base)).toEqual(expected); expect(styles.menuList(base)).toEqual(expected);