Skip to content

direction="horizontal" not work as expected #285

Description

@aminsoraya

After I mentioned :


 <ReactSortable list={state} setList={setState} direction="horizontal">
      {state.map((item) => (
        <div key={item.id}>{item.name}</div>
      ))}
    </ReactSortable>

It doesn't aligned as expected why?

Activity

  1. R3D347HR4Y commented on Oct 13, 2023

    @R3D347HR4Y

    Same problem here, direction horizontal does not do anything

  2. ADTC commented on Oct 10, 2024

    @ADTC

    Such a strange choice of implementation. It is a naming problem. It looks like: horizontal means vertical, and vertical means horizontal.

    I literally wrote this in my code, because vertical wouldn't do it:

      direction='horizontal' // not sure why, but horizontal means drag up and down

    Note that this doesn't change how your list items are visually laid out on page. It only controls the direction the sortable is expected to work in. You should still use CSS to lay out the elements in a way that matches the expectation, such as using flex-direction, flex-wrap, etc.

  3. kuailingmin commented on Dec 11, 2024

    @kuailingmin

    May I ask when this issue can be fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions