Commit cdb9ca29 authored by 水玉婷's avatar 水玉婷
Browse files

feat:修复历史记录刷新跟点击之间的bug

parent 8344d1e2
......@@ -256,7 +256,14 @@ const getChatRecordList = async (isLoadMore = false) => {
};
// 通用的开始事件处理
const handleStart = (clientY: number, target: HTMLElement) => {
const handleStart = (clientY: number, target: HTMLElement, event: Event) => {
// 检查是否点击了历史记录项(阻止下拉刷新)
const historyItem = (event.target as HTMLElement).closest('.history-item');
if (historyItem) {
// 点击了历史记录项,不触发下拉刷新
return;
}
// 只有在顶部且没有在滚动时才允许下拉刷新
if (target.scrollTop === 0 && !isRefreshing.value) {
pullDownStartY.value = clientY;
......@@ -267,7 +274,7 @@ const handleStart = (clientY: number, target: HTMLElement) => {
// 下拉刷新触摸事件处理
const handleTouchStart = (event: TouchEvent) => {
const target = event.currentTarget as HTMLElement;
handleStart(event.touches[0].clientY, target);
handleStart(event.touches[0].clientY, target, event);
};
// 通用的移动事件处理
......@@ -307,7 +314,7 @@ const handleTouchEnd = () => {
// PC端鼠标事件处理
const handleMouseDown = (event: MouseEvent) => {
const target = event.currentTarget as HTMLElement;
handleStart(event.clientY, target);
handleStart(event.clientY, target, event);
isMouseDown.value = true;
};
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment