mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-05 02:41:34 +00:00
fix: let Enter through when the message box's suggestion list has nothing to show (#31506)
This commit is contained in:
parent
82b5181372
commit
c8a3e10e13
1 changed files with 5 additions and 1 deletions
|
|
@ -55,6 +55,7 @@
|
|||
|
||||
const onKeyDown = (event: KeyboardEvent) => {
|
||||
if (!['ArrowUp', 'ArrowDown', 'Enter', 'Tab', 'Escape'].includes(event.key)) return false;
|
||||
if ((filteredItems ?? []).length === 0) return false;
|
||||
|
||||
if (event.key === 'ArrowUp') {
|
||||
suggestionElement?.selectUp();
|
||||
|
|
@ -89,7 +90,10 @@
|
|||
}
|
||||
</script>
|
||||
|
||||
<div class={(filteredItems ?? []).length > 0 ? '' : 'hidden'} id="suggestions-container">
|
||||
<div
|
||||
class={(filteredItems ?? []).length > 0 ? '' : 'hidden'}
|
||||
id={(filteredItems ?? []).length > 0 ? 'suggestions-container' : undefined}
|
||||
>
|
||||
<DropdownMenu className="w-72 max-w-[calc(100vw-1rem)] overflow-x-hidden font-sans text-xs">
|
||||
<div class="max-h-60 overflow-y-auto overflow-x-hidden scrollbar-thin">
|
||||
{#if char === '/'}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue