Title: Bug - [DragDropSort / DragButton] - aria-label is not customizable and not translatable · Issue #12416 · patternfly/patternfly-react · GitHub
Open Graph Title: Bug - [DragDropSort / DragButton] - aria-label is not customizable and not translatable · Issue #12416 · patternfly/patternfly-react
X Title: Bug - [DragDropSort / DragButton] - aria-label is not customizable and not translatable · Issue #12416 · patternfly/patternfly-react
Description: Describe the problem Two issues in @patternfly/react-drag-drop: The DragButton component has a hardcoded English aria-label default of "Drag button" that cannot be customized by consumers of DragDropSort. DragButton accepts an aria-label...
Open Graph Description: Describe the problem Two issues in @patternfly/react-drag-drop: The DragButton component has a hardcoded English aria-label default of "Drag button" that cannot be customized by consumers of DragDr...
X Description: Describe the problem Two issues in @patternfly/react-drag-drop: The DragButton component has a hardcoded English aria-label default of "Drag button" that cannot be customized by consumers...
Opengraph URL: https://github.com/patternfly/patternfly-react/issues/12416
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Bug - [DragDropSort / DragButton] - aria-label is not customizable and not translatable","articleBody":"**Describe the problem**\n\nTwo issues in `@patternfly/react-drag-drop`:\n\n1. The `DragButton` component has a hardcoded English `aria-label` default of `\"Drag button\"` that cannot be customized by consumers of `DragDropSort`.\n\n `DragButton` accepts an `aria-label` prop ([source](https://github.com/patternfly/patternfly-react/blob/main/packages/react-drag-drop/src/components/DragDrop/DragButton.tsx#L24)), but `Draggable` only passes dnd-kit's `{...attributes}` and `{...listeners}` to it — not consumer-provided props. And `item.props` in `DraggableObject` is spread onto the `Draggable` wrapper `\u003cdiv>`, not onto `DragButton`.\n\n This means there is no way for consumers using `DragDropSort` to provide a translated `aria-label` for the drag handle, which is an i18n/a11y gap.\n\n2. `DragDropContainer` renders the literal text `\"0\"` as the drag overlay when a draggable item has a falsy numeric `id` (e.g. `0`).\n\n**How do you reproduce the problem?**\n\n```tsx\nimport { DragDropSort } from '@patternfly/react-drag-drop';\n\nconst items = [\n { id: 0, content: 'First item' },\n { id: 1, content: 'Second item' },\n];\n\n\u003cDragDropSort items={items} onDrop={(_, newItems) => setItems(newItems)} />\n```\n\n3. Inspect the rendered drag handle button — it always has `aria-label=\"Drag button\"` regardless of locale.\n\n4. Drag the first item (id `0`). The drag overlay renders the text `\"0\"` instead of the item content. This is because [`getDragOverlay`](https://github.com/patternfly/patternfly-react/blob/main/packages/react-drag-drop/src/components/DragDrop/DragDropContainer.tsx#L243) has `if (!activeId) return` which is true for `0`, and the [overlay JSX](https://github.com/patternfly/patternfly-react/blob/main/packages/react-drag-drop/src/components/DragDrop/DragDropContainer.tsx#L293) uses `activeId && getDragOverlay()` which short-circuits to `0` — React renders this as the text `\"0\"`.\n\n**Expected behavior**\n\n5. Consumers should be able to provide a custom/translated `aria-label` for the `DragButton`, either via:\n\n - A prop on `DraggableObject` (e.g. `item.props.dragButtonAriaLabel`)\n - Forwarding relevant props from `item.props` to `DragButton`\n\n6. Falsy numeric ids (e.g. `0`) should work correctly. The checks should use `activeId != null` instead of `!activeId` / `activeId &&`.\n\n**Is this issue blocking you?**\n\nNot blocking. Workaround for issue 1: not possible without forking the component. We currently accept the English-only label. Workaround for issue 2: use string ids.\n\n**Screenshots**\n\nN/A\n\n**What is your environment?**\n\n- `@patternfly/react-drag-drop`: 6.x (pre-release)\n\n- React 18\n\n**What is your product and what release date are you targeting?**\n\nOpenShift Console (no hard deadline for this specific issue)\n\n**Any other information?**\n\nN/A\n\n---\n\n**Jira Issue:** [PF-4132](https://redhat.atlassian.net/browse/PF-4132)","author":{"url":"https://github.com/logonoff","@type":"Person","name":"logonoff"},"datePublished":"2026-05-07T18:38:04Z","url":"https://github.com/patternfly/patternfly-react/issues/12416"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:2e32003d-ca73-3db9-3d20-e1dccb4b172d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 99F4:21E3E7:BE8D28:FCF692:6B00F218 |
| html-safe-nonce | 61f6206075d7305a794c726d879ddfafa2e912bb5cfb6d2f226f38c27e6fa9da |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5OUY0OjIxRTNFNzpCRThEMjg6RkNGNjkyOjZCMDBGMjE4IiwidmlzaXRvcl9pZCI6IjI2NDAwMTU3MjAzMTgwMzg1NTIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 1c34c9016a3e148f5f7f999e1fce091bfa09da892f766dc7e4083c51214327ae |
| hovercard-subject-tag | issue:4401137074 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/patternfly/patternfly-react/12416/issue_layout |
| twitter:image | https://opengraph.githubassets.com/dca724b1890da3b627ee5316d08afe3d3ad6de371a53511c8950aba6c15ce0a1/patternfly/patternfly-react/issues/12416 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/dca724b1890da3b627ee5316d08afe3d3ad6de371a53511c8950aba6c15ce0a1/patternfly/patternfly-react/issues/12416 |
| og:image:alt | Describe the problem Two issues in @patternfly/react-drag-drop: The DragButton component has a hardcoded English aria-label default of "Drag button" that cannot be customized by consumers of DragDr... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | logonoff |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4ef498cbabcbe3c50befc7a5b743e7072ee770b4daf0e15e54801180d1fa91fc |
| turbo-cache-control | no-preview |
| go-import | github.com/patternfly/patternfly-react git https://github.com/patternfly/patternfly-react.git |
| octolytics-dimension-user_id | 6391110 |
| octolytics-dimension-user_login | patternfly |
| octolytics-dimension-repository_id | 84372347 |
| octolytics-dimension-repository_nwo | patternfly/patternfly-react |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 84372347 |
| octolytics-dimension-repository_network_root_nwo | patternfly/patternfly-react |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 9983dd5da06943f833c971dd5b6bc988e2858be5 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width