Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

addEventListener is not working correctly if the root of a nested list has only one list-element #465

Open
tuberlinapp opened this issue Oct 5, 2018 · 1 comment
Labels
bug help wanted info needed More info needs to be provided to discuss/solve the issue test case needed To validate this issue a jsfiddle or codepen is needed.

Comments

@tuberlinapp
Copy link

I'm opening this issue because:

addEventListener is not working correctly if the root of a nested list has only one list-element

supporting information:

  • I use sortable version: 0.9.4
  • I tested in the following browser (incl. versions): Firefox Dev 63.0b11 AND Firefox Standard 62.0.3
  • Windows, OS X/macOS, or Linux?: Windows 10 AND Debian 9

How can the issue be reproduce the problem?

Please add a complete description of how to reproduce the problem.

  • Load the file
  • If you drag "Item 444" above "Item 333" event is not called.
  • If you drag "Item 444" above "Rootpage" event is called.
<!doctype html>

<head>
<meta charset="utf-8">
<title>HTML5 Sortable library</title>
<link rel="stylesheet" href="basscss.css">
  <script src="html5sortable.js"></script>
</head>
<body>
<h2>Drag working, but no event listening on ul-element</h2>
<ul>
  <li>
    Rootpage
    <ul>
      <li>Item 1</li>
      <li>Item 2</li>
      <li>Item 333</li>
      <li>
        Checker
        <ul>
          <li>Item 4</li>
          <li>Item 4</li>
          <li>Item 444</li>
        </ul>
      </li>
      <li>Item 4</li>
      <li>Item 5</li>
      <li>Item 6</li>
      <li>Item 7</li>
    </ul>
  </li>
</ul>
<script>
    sortable('ul', {
        acceptFrom: '*',
        forcePlaceholderSize: true,
        placeholderClass: 'border'
    });
document.querySelector('ul').addEventListener('sortupdate', function(e){
    console.log(e);
});
    </script>
</body>

Thank you for contributing!

Before creating a feature requests, please review the existing feature requests and make sure there isn't one that already describes the feature you are missing:
https://github.com/lukasoppermann/html5sortable/issues?q=is%3Aopen+is%3Aissue+label%3Afeature

What's the feature?

What problem is the feature intended to solve?

Is this feature similar to an existing feature in another project?

@lukasoppermann
Copy link
Owner

Hey @tuberlinapp,

thanks for filing the issue. Do you have any idea on how to solve this by any chance?

@lukasoppermann lukasoppermann added bug help wanted info needed More info needs to be provided to discuss/solve the issue test case needed To validate this issue a jsfiddle or codepen is needed. labels Jul 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug help wanted info needed More info needs to be provided to discuss/solve the issue test case needed To validate this issue a jsfiddle or codepen is needed.
Projects
None yet
Development

No branches or pull requests

2 participants