Always Set draggable="false" on Images — A Small Attribute with Big Impact!
When was the last time you accidentally “dragged” an image with your mouse or finger on a website? You may not have noticed it — but your users certainly do, and they get annoyed.
By default, all images in HTML are draggable. This behavior is rarely useful, and often harmful — especially on mobile, touch interfaces, and drag’n’drop UIs.
The HTML attribute draggable="false"
tells the browser not to allow dragging for an image.
<img src="/logo.png" alt="Logo" draggable="false" />
Now the image can’t accidentally be “grabbed” with a mouse or finger — it stays fixed in the layout.
A user tries to swipe — but instead, the browser starts dragging the image. This often happens:
It breaks the UX and feels like a bug.
If you implement your own drag-and-drop elements (like cards or blocks), images inside them may interfere. The browser may try to drag the image instead of your UI element.
👉 Solution: Always add draggable="false"
to img
elements inside draggable blocks.
Some browsers (especially on iOS) behave unpredictably when dragging images:
UX should be predictable. If a user accidentally triggers drag behavior, it’s distracting and confusing. A simple draggable="false"
keeps the site clean and stable.
draggable="false"
<img src="/avatar.jpg" alt="Profile" draggable="false" />
document.querySelectorAll('img').forEach((img) => {
img.setAttribute('draggable', 'false');
});
<img src="/icon.svg" alt="Icon" draggable={false} />
One small attribute — draggable="false"
:
Scroll through your site and try dragging some images.
If they “grab” — it’s time to add draggable="false"
.