Skip to content

Commit 85f09f7

Browse files
committed
Update MultiSelect.jsx
1 parent 9732def commit 85f09f7

File tree

1 file changed

+14
-16
lines changed

1 file changed

+14
-16
lines changed

src/MultiSelect.jsx

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* eslint-disable no-labels */
2-
import { useState, useEffect, useRef } from 'react'
2+
import React, { useState, useEffect, useRef } from 'react'
33
import Chip from './Chip.jsx'
44
import CloseIcon from './CloseIcon.jsx'
55
import DownIcon from './DownIcon.jsx'
@@ -20,9 +20,9 @@ MultiSelect.defaultProps = {
2020
limit: null,
2121
emptyDataLabel: 'No Data Found',
2222
placeholder: 'Select...',
23-
onChange: () => {},
24-
onMenuOpen: () => {},
25-
onMenuClose: () => {},
23+
onChange: () => { },
24+
onMenuOpen: () => { },
25+
onMenuClose: () => { },
2626
options: [
2727
{
2828
label: 'Empty',
@@ -73,9 +73,8 @@ function MultiSelect({
7373
onClickOutside: onMenuClose
7474
})
7575

76-
const calculatedWidth = `calc(100% - ${
77-
clearable && downArrow ? 60 : downArrow || clearable ? 40 : 5
78-
}px)`
76+
const calculatedWidth = `calc(100% - ${clearable && downArrow ? 60 : downArrow || clearable ? 40 : 5
77+
}px)`
7978

8079
const getValueObjFromOptios = (defaultValue, options) => {
8180
if (!defaultValue) return []
@@ -401,9 +400,8 @@ function MultiSelect({
401400
tabIndex='0'
402401
onKeyPress={openMenu}
403402
style={{ ...style }}
404-
className={`msl-wrp msl-vars ${className} ${
405-
disabled ? 'msl-disabled' : ''
406-
}`}
403+
className={`msl-wrp msl-vars ${className} ${disabled ? 'msl-disabled' : ''
404+
}`}
407405
>
408406
<input name={name} type='hidden' value={value?.map((itm) => itm.value)} />
409407
<div data-msl className={`msl ${menuOpen && getActiveClass()} `}>
@@ -507,12 +505,12 @@ function MultiSelect({
507505
}}
508506
/>
509507
) : (
510-
((search && !search.length) || (options && !options.length)) && (
511-
<option className='msl-option msl-option-disable'>
512-
{emptyDataLabel}
513-
</option>
514-
)
515-
)}
508+
((search && !search.length) || (options && !options.length)) && (
509+
<option className='msl-option msl-option-disable'>
510+
{emptyDataLabel}
511+
</option>
512+
)
513+
)}
516514
</div>
517515
</div>
518516
)

0 commit comments

Comments
 (0)