Skip to content

Commit

Permalink
Merge pull request #100 from frg-fossee/component-search
Browse files Browse the repository at this point in the history
fixed multiple component problem where in if you drag a component you…
  • Loading branch information
rohitgeddam committed Jun 6, 2020
2 parents 5cdefc9 + f37ef78 commit 479b2d6
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ const searchOptions = {
PREFIX: 'symbol_prefix'
}

// var tempSearchTxt = ''

const searchOptionsList = ['NAME', 'KEYWORD', 'DESCRIPTION', 'COMPONENT_LIBRARY', 'PREFIX']

export default function ComponentSidebar ({ compRef }) {
Expand All @@ -70,13 +72,16 @@ export default function ComponentSidebar ({ compRef }) {
const timeoutId = React.useRef()

const handleSearchOptionType = (evt) => {
setSearchedComponents([])
setSearchOption(evt.target.value)
}

const handleSearchText = (evt) => {
// tempSearchTxt = evt.target.value
if (searchText.length === 0) {
setSearchedComponents([])
}
setSearchedComponents([])
setSearchText(evt.target.value)
// mimic the value so we can access the latest value in our API call.

Expand Down Expand Up @@ -203,7 +208,7 @@ export default function ComponentSidebar ({ compRef }) {

searchedComponentList.map((component, i) => {
// console.log(component)
return (<ListItemIcon key={i}>
return (<ListItemIcon key={component.name}>
<SideComp component={component} />
</ListItemIcon>)
}
Expand Down

0 comments on commit 479b2d6

Please sign in to comment.