0

I want to prevent dragging of ghost image.

Normal way: <img draggable="false">

But I don't know how to set it to <Image /> component

Image component docs: https://nextjs.org/docs/api-reference/next/image

Edit:

<Image draggable="false"/> works, but for Firefox, we need add the same atrribute to parent <a> and in CSS it can't be user-select: none for img and div

It's still difference between Chrome and Firefox.

juliomalves
  • 42,130
  • 20
  • 150
  • 146
Tom
  • 21
  • 3

1 Answers1

1

I don't know about Next.js but if it doesn't allow you to add draggable attribute then you can set it in CSS. I hope the following link helps. https://stackoverflow.com/a/12906840/8900144

praneeth
  • 33
  • 6