Skip to content

Commit 4330a69

Browse files
committed
fix: can not keep text selection, fixed #1895
Signed-off-by: Innei <tukon479@gmail.com>
1 parent 0eedbba commit 4330a69

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

apps/renderer/src/components/ui/markdown/components/Toc.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,13 @@ const TocHoverCard: React.FC<TocHoverCardProps> = ({
163163
handleScrollTo(index, heading.$heading, heading.anchorId)
164164
}}
165165
>
166-
<span className="duration-200 group-hover:text-accent/80">
166+
<span className="select-none duration-200 group-hover:text-accent/80">
167167
{heading.title}
168168
</span>
169169

170-
<span className="ml-4 text-[8px] opacity-50">H{heading.depth}</span>
170+
<span className="ml-4 select-none text-[8px] opacity-50">
171+
H{heading.depth}
172+
</span>
171173
</button>
172174
</li>
173175
))}

apps/renderer/src/modules/entry-content/components/EntryTitle.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export const EntryTitle = ({ entryId, compact }: EntryLinkProps) => {
104104
<div className="mt-2 text-[13px] font-medium text-zinc-500">
105105
{getPreferredTitle(feed || inbox, entry.entries)}
106106
</div>
107-
<div className="flex items-center gap-2 text-[13px] text-zinc-500">
107+
<div className="flex select-none items-center gap-2 text-[13px] text-zinc-500">
108108
{entry.entries.publishedAt && new Date(entry.entries.publishedAt).toLocaleString()}
109109

110110
<div className="flex items-center gap-1">

apps/renderer/src/modules/entry-content/index.desktop.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { ScrollArea } from "@follow/components/ui/scroll-area/index.js"
33
import { useTitle } from "@follow/hooks"
44
import type { FeedModel, InboxModel, SupportedLanguages } from "@follow/models/types"
55
import { IN_ELECTRON } from "@follow/shared/constants"
6-
import { clearSelection, stopPropagation } from "@follow/utils/dom"
6+
import { stopPropagation } from "@follow/utils/dom"
77
import { cn } from "@follow/utils/utils"
88
import { ErrorBoundary } from "@sentry/react"
99
import { useEffect, useMemo, useRef } from "react"
@@ -166,9 +166,8 @@ export const EntryContent: Component<EntryContentProps> = ({
166166
ref={scrollerRef}
167167
>
168168
<div
169-
onPointerDown={clearSelection}
170169
style={stableRenderStyle}
171-
className="duration-200 ease-in-out animate-in fade-in slide-in-from-bottom-24 f-motion-reduce:fade-in-0 f-motion-reduce:slide-in-from-bottom-0"
170+
className="select-text duration-200 ease-in-out animate-in fade-in slide-in-from-bottom-24 f-motion-reduce:fade-in-0 f-motion-reduce:slide-in-from-bottom-0"
172171
key={entry.entries.id}
173172
>
174173
<article
@@ -179,7 +178,7 @@ export const EntryContent: Component<EntryContentProps> = ({
179178
<EntryTitle entryId={entryId} compact={compact} />
180179

181180
<WrappedElementProvider boundingDetection>
182-
<div className="mx-auto mb-32 mt-8 max-w-full cursor-auto select-text text-[0.94rem]">
181+
<div className="mx-auto mb-32 mt-8 max-w-full cursor-auto text-[0.94rem]">
183182
<TitleMetaHandler entryId={entry.entries.id} />
184183
<AISummary entryId={entry.entries.id} />
185184
<ErrorBoundary fallback={RenderError}>

0 commit comments

Comments
 (0)