0

I'm looking for a way to disable the possibility to drop text into a textarea. I need that because in Spotify it's possible for the user to drag Tracks, Playlists, etc. And the text representation is just a link.

At the moment we're using this code:

    $(target).find('textarea').each(function(index, elem) {
        elem.addEventListener('dragover', function(e) {
                    e.preventDefault();
                    e.stopPropagation();
                    return false;
            }, false);

        elem.addEventListener('drop', function(e) {
                a(_('messages', 'msgNoDragArea'));

                e.preventDefault();
                e.stopPropagation();
                return false;
            }, false);          
    });     

Is there a way to remove the drop icon of the cursor when the user trys to drop an element? Via HTML attribute, CSS or Javascript?

schlingel
  • 8,560
  • 7
  • 34
  • 62

1 Answers1

0

Try to set the following property on the CSS of the element:

cursor : default;

It will set your cursor to the normal pointer.

agryson
  • 297
  • 2
  • 9
  • Oh, but I use that property in a web app that works perfectly in Chrome (webkit). As stated here : Web Browser Engine Spotify currently uses the Chromium rendering engine to run and display your applications. However, this is an implementation detail and may change in the future. Please do not assume anything about the browser other than it is WebKit based (so WebKit-only CSS attributes can be used). (https://developer.spotify.com/technologies/apps/guidelines/integration/) – agryson Nov 27 '12 at 14:13