Skip to content

Commit

Permalink
feat(Assistant): Replace enter search default behavior only on desktop
Browse files Browse the repository at this point in the history
  • Loading branch information
JF-Cozy committed Oct 9, 2024
1 parent 0831e59 commit e8f019a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/assistant/Conversations/ConversationSearchBar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import ArrowUpIcon from 'cozy-ui/transpiled/react/Icons/ArrowUp'
import StopIcon from 'cozy-ui/transpiled/react/Icons/Stop'
import ButtonBase from 'cozy-ui/transpiled/react/ButtonBase'
import useEventListener from 'cozy-ui/transpiled/react/hooks/useEventListener'
import { useBreakpoints } from 'cozy-ui/transpiled/react/providers/Breakpoints'

import ResultMenu from '../ResultMenu/ResultMenu'
import { useAssistant } from '../AssistantProvider'
Expand All @@ -25,6 +26,7 @@ const ConversationSearchBar = ({
onClose
}) => {
const { t } = useI18n()
const { isMobile } = useBreakpoints()
const { assistantState, onAssistantExecute } = useAssistant()
const { setSearchValue, delayedSetSearchValue } = useSearch()
const [inputValue, setInputValue] = useState('')
Expand Down Expand Up @@ -120,7 +122,7 @@ const ConversationSearchBar = ({
</ButtonBase>
),
onKeyDown: ev => {
if (ev.key === 'Enter') {
if (!isMobile && ev.key === 'Enter') {
ev.preventDefault() // prevent form submit
handleClick()
}
Expand Down

0 comments on commit e8f019a

Please sign in to comment.