Skip to content

Commit

Permalink
Submit search form only when value changes
Browse files Browse the repository at this point in the history
  • Loading branch information
buberdds committed May 14, 2024
1 parent 380deaa commit 4100cc2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions .changelog/1411.bugfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix mobile search issues
3 changes: 2 additions & 1 deletion src/app/components/Search/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { typingDelay } from '../../../styles/theme'
import { isValidMnemonic } from '../../utils/helpers'
import Collapse from '@mui/material/Collapse'
import { getAppTitle } from '../../../config'
import console from 'console'

Check warning on line 28 in src/app/components/Search/index.tsx

View workflow job for this annotation

GitHub Actions / lint

'console' is defined but never used

export type SearchVariant = 'button' | 'icon' | 'expandable'

Expand Down Expand Up @@ -141,7 +142,7 @@ const SearchCmp: FC<SearchProps> = ({ scope, variant, disabled, onFocusChange: o

const onFormSubmit = (e?: FormEvent) => {
e?.preventDefault()
if (value) {
if (value && value !== valueInSearchParams) {
navigate(RouteUtils.getSearchRoute(scope, valueWithoutPrefix))
}
}
Expand Down

0 comments on commit 4100cc2

Please sign in to comment.