Skip to content

Edge-Drop is a clipboard shelf on the edge of your screen. Hover to open it. Drag files and images into any app, click to copy text and links. Free and open-source for Windows.

fix(ui): restore razor-sharp text rendering and improve action button hit testing

Deepender25b1ceecfd9932
diff --git a/src/components/ClipboardItem.tsx b/src/components/ClipboardItem.tsx
index c3bcb57..268e4c1 100644
--- a/src/components/ClipboardItem.tsx
+++ b/src/components/ClipboardItem.tsx
@@ -123,7 +123,6 @@ const ClipboardItemBase = forwardRef<HTMLDivElement, Props>(({ item }, ref) => {
damping: 28,
mass: 0.6
}}
- style={{ willChange: 'transform, opacity' }}
className={`item${item.pinned ? ' pinned' : ''}${isBundle ? ' bundle' : ''}`}
>
{copied && (
@@ -204,13 +203,15 @@ const ClipboardItemBase = forwardRef<HTMLDivElement, Props>(({ item }, ref) => {
<div
className="actions"
- onClick={(e) => e.stopPropagation()}
+ onClick={(e) => { e.stopPropagation(); e.preventDefault(); }}
style={{ display: isBundle && expanded ? 'none' : undefined }}
>
<button
className={`act${item.pinned ? ' active' : ''}`}
title={item.pinned ? t('item.unpin') : t('item.pin')}
onClick={(e) => {
+ e.stopPropagation()
+ e.preventDefault()
e.currentTarget.blur()
playToggleSound(!item.pinned)
togglePin(item.id, !item.pinned)
@@ -223,6 +224,7 @@ const ClipboardItemBase = forwardRef<HTMLDivElement, Props>(({ item }, ref) => {
title={isPreviewing ? t('header.close') : t('item.expand')}
onClick={(e) => {
e.stopPropagation()
+ e.preventDefault()
e.currentTarget.blur()
playCardExpandSound(!isPreviewing)
const rect = e.currentTarget.closest('.item-main')?.getBoundingClientRect()
@@ -232,10 +234,16 @@ const ClipboardItemBase = forwardRef<HTMLDivElement, Props>(({ item }, ref) => {
>
{isPreviewing ? <ContractIcon /> : <ExpandIcon />}
</button>
- <button className="act" title={t('item.copy')} onClick={(e) => {
- e.currentTarget.blur()
- onCopy(e)
- }}>
+ <button
+ className="act"
+ title={t('item.copy')}
+ onClick={(e) => {
+ e.stopPropagation()
+ e.preventDefault()
+ e.currentTarget.blur()
+ onCopy(e)
+ }}
+ >
<CopyIcon />
</button>
{item.data.kind === 'text' && item.data.isUrl && (
@@ -244,6 +252,7 @@ const ClipboardItemBase = forwardRef<HTMLDivElement, Props>(({ item }, ref) => {
title={t('flyout.openLink')}
onClick={(e) => {
e.stopPropagation()
+ e.preventDefault()
e.currentTarget.blur()
playButtonClickSound()
window.open((item.data as any).text, '_blank')
@@ -257,6 +266,8 @@ const ClipboardItemBase = forwardRef<HTMLDivElement, Props>(({ item }, ref) => {
className="act danger"
title={t('item.delete')}
onClick={(e) => {
+ e.stopPropagation()
+ e.preventDefault()
e.currentTarget.blur()
playDeleteSound()
remove(item.id)
diff --git a/src/styles/item.css b/src/styles/item.css
index 9ffe6f2..bb2c2cb 100644
--- a/src/styles/item.css
+++ b/src/styles/item.css
@@ -92,6 +92,9 @@
word-break: break-word;
white-space: pre-wrap;
transition: color 0.16s ease;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+ text-rendering: optimizeLegibility;
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
@@ -212,20 +215,17 @@
position: absolute;
top: 8px;
right: 8px;
- transform: translateY(-2px) scale(0.92);
+ transform: scale(0.96);
display: flex;
gap: 3px;
padding: 3px 5px;
background: #141416;
- border: 1px solid rgba(255, 255, 255, 0.12);
+ border: 1px solid rgba(255, 255, 255, 0.16);
border-radius: 999px;
opacity: 0;
pointer-events: none;
- /* Specific properties — prevents `all` from catching unrelated inherited changes.
- will-change promotes the layer ahead of hover so the slide-in is smooth. */
- transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1),
- transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
- will-change: transform, opacity;
+ transition: opacity 0.14s ease, transform 0.14s ease;
+ will-change: opacity, transform;
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.75);
z-index: 20;
}
@@ -235,23 +235,29 @@
.item-main.force-actions .actions {
opacity: 1;
pointer-events: auto;
- transform: translateY(0) scale(1);
+ transform: scale(1);
}
.act {
- width: 28px;
- height: 28px;
+ width: 30px;
+ height: 30px;
display: grid;
place-items: center;
border-radius: 50%;
- color: rgba(255, 255, 255, 0.6);
+ color: rgba(255, 255, 255, 0.75);
background: transparent;
- transition: background 0.14s ease, color 0.14s ease;
+ cursor: pointer;
+ outline: none;
+ border: none;
+ transition: background 0.12s ease, color 0.12s ease, transform 0.1s ease;
}
.act:hover {
- background: rgba(255, 255, 255, 0.15);
+ background: rgba(255, 255, 255, 0.18);
color: #fff;
}
+.act:active {
+ transform: scale(0.90);
+}
.act.danger:hover {
background: rgba(239, 68, 68, 0.22);
color: #f87171;