Skip to content

Commit

Permalink
searh on submit
Browse files Browse the repository at this point in the history
  • Loading branch information
OlegMoshkovich committed Sep 19, 2022
1 parent c7c21ff commit a1ef190
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Components/SearchBar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default function SearchBar({fileOpen}) {
const onInputChange = (event) => setInputText(event.target.value)
const searchInputRef = useRef(null)
// input length is dynamically calculated in order to fit the input string into the Text input
const widthPerChar = 5
const widthPerChar = 6.5
const padding = 130
const calculatedInputWidth = (Number(inputText.length) * widthPerChar) + padding
// it is passed into the styles as a property the input width needs to change when the querry exeeds the minWidth
Expand Down Expand Up @@ -95,7 +95,6 @@ export default function SearchBar({fileOpen}) {
<Paper
component='form'
className={classes.root}
onSubmit={onSubmit}
elevation={0}
sx={{backgroundColor: colorMode.isDay() ? '#E8E8E8' : '#4C4C4C'}}
>
Expand All @@ -104,6 +103,7 @@ export default function SearchBar({fileOpen}) {
inputRef={searchInputRef}
value={inputText}
onChange={onInputChange}
onSubmit={onSubmit}
error={true}
placeholder={'Search / Insert GitHub link'}
sx={{
Expand Down

0 comments on commit a1ef190

Please sign in to comment.