mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-03 18:40:00 +08:00
fix(core): unexpected double-click behavior when selecting multiple options on all doc pages (#8461)
close AF-968
This commit is contained in:
@@ -213,6 +213,7 @@ const CollectionListItemWrapper = forwardRef(
|
|||||||
|
|
||||||
const commonProps = useMemo(
|
const commonProps = useMemo(
|
||||||
() => ({
|
() => ({
|
||||||
|
role: 'list-item',
|
||||||
'data-testid': 'collection-list-item',
|
'data-testid': 'collection-list-item',
|
||||||
'data-collection-id': collectionId,
|
'data-collection-id': collectionId,
|
||||||
'data-draggable': draggable,
|
'data-draggable': draggable,
|
||||||
|
|||||||
@@ -345,6 +345,7 @@ const PageListItemWrapper = forwardRef(
|
|||||||
|
|
||||||
const commonProps = useMemo(
|
const commonProps = useMemo(
|
||||||
() => ({
|
() => ({
|
||||||
|
role: 'list-item',
|
||||||
'data-testid': 'page-list-item',
|
'data-testid': 'page-list-item',
|
||||||
'data-page-id': pageId,
|
'data-page-id': pageId,
|
||||||
'data-draggable': draggable,
|
'data-draggable': draggable,
|
||||||
|
|||||||
@@ -61,7 +61,9 @@ const useItemSelectionStateEffect = () => {
|
|||||||
if (
|
if (
|
||||||
target.tagName === 'BUTTON' ||
|
target.tagName === 'BUTTON' ||
|
||||||
target.tagName === 'INPUT' ||
|
target.tagName === 'INPUT' ||
|
||||||
(e.target as HTMLElement).closest('button, input, [role="toolbar"]')
|
(e.target as HTMLElement).closest(
|
||||||
|
'button, input, [role="toolbar"], [role="list-item"]'
|
||||||
|
)
|
||||||
) {
|
) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -198,6 +198,7 @@ const TagListItemWrapper = forwardRef(
|
|||||||
|
|
||||||
const commonProps = useMemo(
|
const commonProps = useMemo(
|
||||||
() => ({
|
() => ({
|
||||||
|
role: 'list-item',
|
||||||
'data-testid': 'tag-list-item',
|
'data-testid': 'tag-list-item',
|
||||||
'data-tag-id': tagId,
|
'data-tag-id': tagId,
|
||||||
'data-draggable': draggable,
|
'data-draggable': draggable,
|
||||||
|
|||||||
Reference in New Issue
Block a user