mirror of
https://github.com/open-webui/open-webui.git
synced 2026-11-15 09:31:21 +00:00
fix(a11y): sorting or paging a workspace or notes list keeps keyboard focus (#33743)
This commit is contained in:
parent
72398bbc7a
commit
bc14c37670
4 changed files with 4 additions and 18 deletions
|
|
@ -159,8 +159,6 @@
|
|||
|
||||
const reset = () => {
|
||||
page = 1;
|
||||
items = null;
|
||||
total = null;
|
||||
allItemsLoaded = false;
|
||||
itemsLoading = false;
|
||||
notes = {};
|
||||
|
|
@ -230,7 +228,7 @@
|
|||
allItemsLoaded = false;
|
||||
}
|
||||
|
||||
if (items) {
|
||||
if (items && page > 1) {
|
||||
const existingIds = new Set(items.map((item) => item.id));
|
||||
const newItems = pageItems.filter((item) => !existingIds.has(item.id));
|
||||
items = [...items, ...newItems];
|
||||
|
|
|
|||
|
|
@ -131,8 +131,6 @@
|
|||
|
||||
const reset = () => {
|
||||
page = 1;
|
||||
items = null;
|
||||
total = null;
|
||||
allItemsLoaded = false;
|
||||
itemsLoading = false;
|
||||
};
|
||||
|
|
@ -184,7 +182,7 @@
|
|||
allItemsLoaded = false;
|
||||
}
|
||||
|
||||
if (items) {
|
||||
if (items && page > 1) {
|
||||
const existingIds = new Set(items.map((item) => item.id));
|
||||
const newItems = pageItems.filter((item) => !existingIds.has(item.id));
|
||||
items = [...items, ...newItems];
|
||||
|
|
|
|||
|
|
@ -81,7 +81,6 @@
|
|||
let prompts = null;
|
||||
let tags = [];
|
||||
let total = null;
|
||||
let loading = false;
|
||||
|
||||
let showDeleteConfirm = false;
|
||||
let showCreateModal = false;
|
||||
|
|
@ -139,7 +138,6 @@
|
|||
|
||||
const handleSearchInput = () => {
|
||||
searchController?.abort();
|
||||
loading = true;
|
||||
clearTimeout(searchDebounceTimer);
|
||||
searchDebounceTimer = setTimeout(() => {
|
||||
if (page !== 1) {
|
||||
|
|
@ -187,7 +185,6 @@
|
|||
searchController = new AbortController();
|
||||
const { signal } = searchController;
|
||||
|
||||
loading = true;
|
||||
try {
|
||||
const res = await getPromptItems(
|
||||
localStorage.token,
|
||||
|
|
@ -219,8 +216,6 @@
|
|||
}
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
} finally {
|
||||
if (!signal.aborted) loading = false;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -550,7 +545,7 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
{#if prompts === null || loading}
|
||||
{#if prompts === null}
|
||||
<div class="w-full h-full flex justify-center items-center my-16 mb-24">
|
||||
<Spinner className="size-5" />
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -109,7 +109,6 @@
|
|||
|
||||
let filteredItems = null;
|
||||
let total = null;
|
||||
let loading = false;
|
||||
|
||||
let tagsContainerElement: HTMLDivElement;
|
||||
let viewOption = '';
|
||||
|
|
@ -188,7 +187,6 @@
|
|||
searchController = new AbortController();
|
||||
const { signal } = searchController;
|
||||
|
||||
loading = true;
|
||||
try {
|
||||
const res = await getSkillItems(
|
||||
localStorage.token,
|
||||
|
|
@ -212,14 +210,11 @@
|
|||
}
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
} finally {
|
||||
if (!signal.aborted) loading = false;
|
||||
}
|
||||
};
|
||||
|
||||
const handleSearchInput = () => {
|
||||
searchController?.abort();
|
||||
loading = true;
|
||||
clearTimeout(searchDebounceTimer);
|
||||
searchDebounceTimer = setTimeout(() => {
|
||||
if (page !== 1) {
|
||||
|
|
@ -465,7 +460,7 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
{#if filteredItems === null || loading}
|
||||
{#if filteredItems === null}
|
||||
<div class="w-full h-full flex justify-center items-center my-16 mb-24">
|
||||
<Spinner className="size-5" />
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue