<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>uggds</author_name>
  <author_url>https://blog.hatena.ne.jp/uggds/</author_url>
  <blog_title>UGA Boxxx</blog_title>
  <blog_url>https://uga-box.hatenablog.com/</blog_url>
  <categories>
    <anon>dnd-kit</anon>
  </categories>
  <description>dnd-kit を使ってドラッグ＆ドロップを実装する際、フォーム要素（input や button など）を含む場合に注意が必要だった ドラッグ操作とクリック・入力操作が競合しないように制御する方法を調べたのでメモ 発生した問題 input や select をクリックすると、意図せずドラッグが開始される ボタンを押したいだけなのに、ドラッグ挙動が優先される スマートフォン環境でタップ操作とドラッグ操作が干渉する 解決方法1: イベント伝播を止める フォーム要素に対して、onPointerDown などのイベントでドラッグ操作への伝播を防ぐ 実装例 &lt;input type=&quot;text&quot; onP…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fuga-box.hatenablog.com%2Fentry%2F2025%2F04%2F10%2F000000&quot; title=&quot;【dnd-kit】input や button を避けてドラッグ開始条件を制御する - UGA Boxxx&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2025-04-10 00:00:00</published>
  <title>【dnd-kit】input や button を避けてドラッグ開始条件を制御する</title>
  <type>rich</type>
  <url>https://uga-box.hatenablog.com/entry/2025/04/10/000000</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
