From 5815d63b7b380bbe479f8395e21cb52a1657a539 Mon Sep 17 00:00:00 2001 From: Joan Perals Tresserra Date: Tue, 21 Mar 2023 18:02:33 +0100 Subject: [PATCH] Fix screen reader announcement for drag end event --- src/collection-preferences/content-display.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/collection-preferences/content-display.tsx b/src/collection-preferences/content-display.tsx index 649bc57af8..af6203475b 100644 --- a/src/collection-preferences/content-display.tsx +++ b/src/collection-preferences/content-display.tsx @@ -111,7 +111,7 @@ export default function ContentDisplayPreference({ onDragEnd({ active, over }) { if (over && liveAnnouncementDndItemCommitted) { const initialIndex = sortedOptions.findIndex(option => option.id === active.id); - const finalIndex = options.findIndex(option => option.id === over.id); + const finalIndex = sortedOptions.findIndex(option => option.id === over.id); return liveAnnouncementDndItemCommitted(initialIndex + 1, finalIndex + 1, options.length); } },