mirror of
https://github.com/open-webui/open-webui.git
synced 2026-08-28 05:27:35 +00:00
fix(ui): prevent space key from opening file/directory during rename in knowledge base (#25627)
This commit is contained in:
parent
8bc4ac2641
commit
a8e5f0a54d
2 changed files with 13 additions and 1 deletions
|
|
@ -116,7 +116,10 @@
|
|||
<button
|
||||
class="relative flex items-center gap-1 rounded-xl p-2 text-left flex-1 justify-between"
|
||||
type="button"
|
||||
on:click={() => onNavigate(directory.id)}
|
||||
on:click={() => {
|
||||
if (editing) return;
|
||||
onNavigate(directory.id);
|
||||
}}
|
||||
>
|
||||
<div>
|
||||
<div class="flex gap-2 items-center line-clamp-1">
|
||||
|
|
@ -129,6 +132,10 @@
|
|||
on:keydown={(e) => {
|
||||
if (e.key === 'Enter') submitRename();
|
||||
if (e.key === 'Escape') cancelRename();
|
||||
if (e.key === ' ') e.stopPropagation();
|
||||
}}
|
||||
on:keyup={(e) => {
|
||||
if (e.key === ' ') e.stopPropagation();
|
||||
}}
|
||||
on:blur={submitRename}
|
||||
on:click={(e) => e.stopPropagation()}
|
||||
|
|
|
|||
|
|
@ -108,6 +108,7 @@
|
|||
class="relative flex items-center gap-1 rounded-xl p-2 text-left flex-1 justify-between"
|
||||
type="button"
|
||||
on:click={() => {
|
||||
if (editingFileId) return;
|
||||
onClick(file?.id ?? file?.tempId);
|
||||
}}
|
||||
on:dblclick={() => {
|
||||
|
|
@ -125,6 +126,10 @@
|
|||
on:keydown={(e) => {
|
||||
if (e.key === 'Enter') submitRename();
|
||||
if (e.key === 'Escape') cancelRename();
|
||||
if (e.key === ' ') e.stopPropagation();
|
||||
}}
|
||||
on:keyup={(e) => {
|
||||
if (e.key === ' ') e.stopPropagation();
|
||||
}}
|
||||
on:blur={submitRename}
|
||||
on:click={(e) => e.stopPropagation()}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue