```
from typing import Sequence

import flet as ft
from flet import Icons
from flet.core.colors import Colors


def inner_card(title_field: ft.TextField, content_field: ft.TextField, buttons: Sequence[ft.Control]) -> ft.Row:
    _row = ft.Row(
        controls=[
            ft.Container(
                content=ft.Icon(Icons.DRAG_HANDLE, size=24),
                alignment=ft.alignment.center,
                width=40,
                height=40,
            ),
            ft.Column(
                controls=[title_field, content_field],
                expand=True
            ),
            ft.Column(
                controls=buttons,
            )
        ],
        spacing=5,
    )
    return _row


class RemovableTextInput(ft.Card):
    def __init__(self, on_delete=None, on_duplicate=None, on_reorder=None, index=0, **kwargs):
        super().__init__(expand=True)
        self.on_delete = on_delete
        self.on_duplicate = on_duplicate
        self.on_reorder = on_reorder
        self.index = index

        self.title_field = ft.TextField(hint_text="タイトル", expand=True, **kwargs)
        self.content_field = ft.TextField(hint_text="内容", multiline=True, expand=True, **kwargs)

        duplicate_button = ft.IconButton(
            icon=Icons.COPY_OUTLINED,
            tooltip="コピー",
            on_click=self._on_duplicate_click,
        )

        delete_button = ft.IconButton(
            icon=Icons.CLOSE,
            icon_size=20,
            tooltip="削除",
            on_click=self._on_delete_click,
        )

        # カード全体の内容を作成
        card_content = inner_card(
            self.title_field, self.content_field, [duplicate_button, delete_button]
        )

        # ドラッグ中に表示する半透明のカード
        dragging_content = ft.Container(
            content=inner_card(self.title_field, self.content_field, [duplicate_button, delete_button]),
            bgcolor=Colors.with_opacity(0.8, color=Colors.SURFACE_TINT),
            padding=10,
            border_radius=10,
        )

        # Draggableでカード全体をラップ
        self.draggable = ft.Draggable(
            group="fields",
            content=card_content,
            content_when_dragging=dragging_content,
            on_drag_start=self._on_drag_start,
            on_drag_complete=self._on_drag_complete,
        )

        # DragTargetでDraggableをラップ
        self.drag_target = ft.DragTarget(
            group="fields",
            content=self.draggable,
            on_will_accept=self._on_will_accept,
            on_accept=self._on_accept,
            on_leave=self._on_leave,
        )

        self.content = self.drag_target

    def _on_drag_start(self, e):
        # ドラッグ開始時に現在の値を取得してドラッグ中のコンテンツを更新
        self._update_dragging_content()
        if self.on_reorder:
            self.on_reorder("start", self)

    def _update_dragging_content(self):
        # ドラッグ中のコンテンツに現在の値を反映
        dragging_content = ft.Container(
            content=ft.Row(
                controls=[
                    ft.Container(
                        content=ft.Icon(Icons.DRAG_HANDLE, size=24),
                        alignment=ft.alignment.center,
                        width=40,
                        height=40,
                    ),
                    ft.Column(
                        controls=[
                            ft.TextField(
                                value=self.title_field.value or "",
                                hint_text="タイトル",
                                expand=True,
                                read_only=True
                            ),
                            ft.TextField(
                                value=self.content_field.value or "",
                                hint_text="内容",
                                multiline=True,
                                expand=True,
                                read_only=True
                            )
                        ],
                        expand=True
                    ),
                    ft.Column(
                        controls=[
                            ft.IconButton(icon=Icons.COPY_OUTLINED, disabled=True),
                            ft.IconButton(icon=Icons.CLOSE, icon_size=20, disabled=True),
                        ],
                    )
                ],
                spacing=5,
            ),
            bgcolor=Colors.with_opacity(0.8, Colors.SURFACE_TINT),
            padding=10,
            border_radius=10,
            opacity=0.8,  # 半透明に設定
        )
        self.draggable.content_when_dragging = dragging_content

    def _on_drag_complete(self, e):
        if self.on_reorder:
            self.on_reorder("complete", self)

    def _on_will_accept(self, e):
        if self.on_reorder:
            self.on_reorder("hover", self)
        e.control.update()

    def _on_accept(self, e):
        if self.on_reorder:
            self.on_reorder("drop", self)

    def _on_leave(self, e):
        if self.on_reorder:
            self.on_reorder("leave", self)

    def _on_delete_click(self, e):
        if self.on_delete:
            self.on_delete(self)

    def _on_duplicate_click(self, e):
        if self.on_duplicate:
            self.on_duplicate(self)

    def get_values(self):
        return {
            "title": self.title_field.value,
            "content": self.content_field.value
        }


def main(page: ft.Page):
    page.title = "削除可能なTextField（ドラッグ&ドロップ対応）"
    page.padding = 20

    field_container = ft.Column(spacing=10)

    # ドラッグ中の情報を保持
    drag_state = {
        "dragging_field": None,
        "original_index": None,
        "current_hover_index": None
    }

    def update_indices():
        """各フィールドのインデックスを更新"""
        for i, field in enumerate(field_container.controls):
            field.index = i

    def reorder_fields(action, target_field):
        """フィールドの並び替え処理"""
        if action == "start":
            # ドラッグ開始
            drag_state["dragging_field"] = target_field
            drag_state["original_index"] = field_container.controls.index(target_field)
            drag_state["current_hover_index"] = drag_state["original_index"]

        elif action == "hover" and drag_state["dragging_field"]:
            # ホバー中（リアルタイムで入れ替え）
            dragging_field = drag_state["dragging_field"]
            if dragging_field != target_field:
                dragging_index = field_container.controls.index(dragging_field)
                target_index = field_container.controls.index(target_field)

                # フィールドを入れ替え
                field_container.controls.pop(dragging_index)
                field_container.controls.insert(target_index, dragging_field)
                drag_state["current_hover_index"] = target_index

                update_indices()
                page.update()

        elif action == "complete":
            # ドラッグ完了（状態をリセット）
            drag_state["dragging_field"] = None
            drag_state["original_index"] = None
            drag_state["current_hover_index"] = None
            update_indices()
            page.update()

    # 削除確認ダイアログ
    def confirm_delete(field):
        def close_dialog(e):
            dialog.open = False
            page.update()

        def yes_click(e):
            field_container.controls.remove(field)
            dialog.open = False
            update_indices()
            page.update()

        dialog = ft.AlertDialog(
            modal=True,
            title=ft.Text("削除の確認"),
            content=ft.Text("このフィールドを削除してもよろしいですか？"),
            actions=[
                ft.TextButton("いいえ", on_click=close_dialog),
                ft.TextButton("はい", on_click=yes_click),
            ],
            actions_alignment=ft.MainAxisAlignment.END,
        )

        page.overlay.append(dialog)
        dialog.open = True
        page.update()

    def duplicate_field(field):
        values = field.get_values()
        new_field = RemovableTextInput(
            on_delete=confirm_delete,
            on_duplicate=duplicate_field,
            on_reorder=reorder_fields,
            index=field.index + 1
        )
        new_field.title_field.value = values["title"]
        new_field.content_field.value = values["content"]

        # 元のフィールドの次に挿入
        index = field_container.controls.index(field)
        field_container.controls.insert(index + 1, new_field)
        update_indices()
        page.update()

    def add_field(e):
        new_field = RemovableTextInput(
            on_delete=confirm_delete,
            on_duplicate=duplicate_field,
            on_reorder=reorder_fields,
            index=len(field_container.controls)
        )
        field_container.controls.append(new_field)
        update_indices()
        page.update()

    # 初期フィールドを3つ追加
    for i in range(3):
        field_container.controls.append(
            RemovableTextInput(
                on_delete=confirm_delete,
                on_duplicate=duplicate_field,
                on_reorder=reorder_fields,
                index=i
            )
        )

    page.add(
        ft.Text(
            "ハンドルをドラッグしてフィールドを並び替え",
            size=20,
            weight=ft.FontWeight.BOLD
        ),
        field_container,
        ft.ElevatedButton("フィールドを追加", on_click=add_field),
    )


ft.app(target=main)
```

機能を一切変えず、より安定して動作させるためにできることは？