Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9024669
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T06:04:52+00:00 2026-06-16T06:04:52+00:00

In the application below, the drop method is never called. The drop target (

  • 0

In the application below, the drop method is never called. The drop target (div2) is indicated by cancelling event in dragEnter and dragOver events but drop is not triggered. HTML and .dart are as follows:

<!DOCTYPE html>
<html>
 <head>
 <meta charset="utf-8">
 <title>Dandd</title>
 <link rel="stylesheet" href="dandd.css">
</head>
<body>
<h1>Drag and drop</h1>

<p>Hello world from Dart!</p>
<div>
  <label id='lbl' draggable='true'  style='border: 1px solid; '>div1</label>
 </div>
<p></p>

<div id='div2'>
  <label>div2</label>
 </div>
<script type="application/dart" src='dandd.dart > </script>
<script type='text/javascript'  
   src="https://dart.googlecode.com/svn/branches/bleeding_edge/dart/client/dart.js"></script>
</body>
</html>

and here is dart file

import 'dart:html';

void main() {
  query('#lbl')
    ..on.dragStart.add(onDragStart)
    ..on.dragEnd.add(onDragEnd);

  query('#div2')
    ..on.dragEnter.add(onDragEnter)
    ..on.dragOver.add(onDragOver)
    ..on.drop.add(onDrop);

  query('#div2')
    ..on.dragLeave.add(onDragLeave);
}

onDragStart(MouseEvent e) {
  print('started');
  var lbl = e.target as LabelElement;
  lbl.style.opacity = '0.4';
  e.dataTransfer.setData('text', lbl.id);
}

onDragEnd(MouseEvent e) {
 var lbl = e.target as LabelElement;
 lbl.style.opacity = '1.0';
 print('drag end called');
}

onDragEnter(MouseEvent e) {
  e.stopPropagation();
  e.dataTransfer.dropEffect = 'move';
  var x = e.target as DivElement;
  x.classes.add('blueborder');
}

onDragOver(MouseEvent e) {
  e.stopPropagation();
  e.dataTransfer.dropEffect = 'move';
  var x = e.target as DivElement;
  x.classes.add('blueborder');
}

onDragLeave(MouseEvent e) {
  var x = e.target as DivElement;
  x.classes.remove('blueborder');
}

onDrop(MouseEvent e){
  print('on drop called');
  var x = e.target as DivElement;
  x.classes.remove('blueborder');
  String sid = e.dataTransfer.getData('text');
  var v = query('#{sid}');
  x.children.add(v);
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T06:04:53+00:00Added an answer on June 16, 2026 at 6:04 am

    It looks like a bug. See issue 6646.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have implemented drag and drop in my application, but am having some difficulty
In my Eclipse RCP application I have a TreeViewer that is a drop target
I created a application with a drop down arrow, but the size of the
Given the sample console application below: QUESTION #1 : Why does .Name() return typeof
I have a Student class in my application as below: public class Student {
When i am running my application as shown below error shows can you tell
I am loading a WebView in an Android application with the below code: mWebView.loadURL(https://wat.harminson.com/html/index.html);
Below I have an application. Now on the previous page user types in a
Below is a self-contained application you can run. It simply displays a spark combo
Application: WPF Application consisting of a textbox on top and a listbox below Users

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.