Coder Social home page Coder Social logo

sitepoint-editors / accessible-drag-and-drop Goto Github PK

View Code? Open in Web Editor NEW
40.0 40.0 20.0 108 KB

Extend the capabilities of HTML5 drag and drop — so it can handle multiple elements, and support keyboard interaction

CSS 8.82% HTML 7.27% JavaScript 83.91%

accessible-drag-and-drop's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

accessible-drag-and-drop's Issues

Open Source License for this code?

Hi,

It looks like a lot of the code for sitepoint here on Gitbhub is MIT licensed. Is this particular code licensed under MIT as well?

Thanks,
-Rich

Handle HTML content in <li>

Hello,
first thanks for that demos that helped me for a project.

Based on demo4a code I found that it is possible to include HTML stuff within the li: it is well displayed.
BUT: it can only be selected/grabbed when cliking on pure text, not on (let say) bold or italic parts.
It is because the (let say) bold element is recieved in document.addEventListener and it don't have the draggable attribute. I changed this function in that way:
// for HTML content in the li the event comes for the that entity // if not pure text. try to reach li parent var tmp = e.target; while (tmp.nodeName != "LI") { tmp = tmp.parentElement; }
and then replace e.target by tmp in the following code (if(tmp.getAttribute('draggable')) and tmp.getAttribute('aria-grabbed') == 'false').

It works fine for me (li are selectable everywhere) and draggable.
You may consider inserting it, probably after improving it.
Note: this code doesn't cover the multi-selection case. If you select as 2nd (or more) element a line by clicking a HTMLed part it is ignored. The same changes should be applied somewhere else.

Regards,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.