SortableJS / react-sortablejs

React bindings for SortableJS
http://sortablejs.github.io/react-sortablejs/
MIT License
2.07k stars 211 forks source link

[bug] Text is staying all the time in the top #283

Open vadimt2 opened 1 year ago

vadimt2 commented 1 year ago

Please use this code below, Put value in the top inpiut and drag it down.


  const [items, setItems] = useState([
    { id: '1', name: 'Item 1' },
    { id: '2', name: 'Item 2' },
    { id: '3', name: 'Item 3' }
  ])
<ReactSortable list={items} setList={setItems}>
      {items.map((item, index) => (
        <div key={index}>
          <span className="my-handle">::</span>
          <input type="text" placeholder={item.name} />
        </div>
      ))}
    </ReactSortable>```