Skip to content

Disabled items should not be re-orderable in the List Component #6229

@jeffcap1

Description

@jeffcap1

Expected Behavior

When a List component is provided both an onOrder function and an array of disabled itemKey's the disabled items should not be re-orderable.

Actual Behavior

The disabled items are still able to be re-ordered through both Drag 'n Drop as well as clicking the up/down arrow to re-order the item.

URL, screen shot, or Codepen exhibiting the issue

Codepen example: https://codesandbox.io/s/grommet-v2-template-forked-82ogqc

Steps to Reproduce

  1. Create a list component with an onOrder function
  2. Create an array of itemKeys to disable
  3. The list will appear and be re-orderable with some items disabled
  4. Click the up/down arrow on any disabled item or Drag 'n Drop a disabled item and the list will be re-ordered.

Your Environment

  • React version: 17.0.2
  • Grommet version: 2.25.0
  • Browser Name and version: Microsoft Edge 103.0.1264.51
  • Operating System and version (desktop or mobile): macOS 12.4 (Desktop)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementA suggestion to add to or change behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions