Note that there are some explanatory texts on larger screens.

plurals
  1. POJQuery UI droppable drop only to a specific area
    primarykey
    data
    text
    <p>I am having an issue trying to drag an element to the placeholder which has another placeholder in it.</p> <p>Let say I have:</p> <pre><code>page.find("ol.question-group-placeholder").droppable({ accept: ".question-type, .question-text", activeClass: "placeholder-active", hoverClass: "placeholder-hover", drop: function (event, ui) { alert("Dropped to the question group!"); } }); </code></pre> <p>and:</p> <pre><code>page.find("ol.question-placeholder").droppable({ accept: ".question-text", activeClass: "placeholder-active", hoverClass: "placeholder-hover", drop: function (event, ui) { alert("Dropped to the question!") } }); </code></pre> <p>The first one is question group OL which accepts only LI's with classes: <code>.question-type</code> and <code>.question-text</code>.</p> <p>The second one is question OL which accepts only LI's with the class: <code>question-text</code>.</p> <p>When I am dragging an element with the class <code>question-type</code> in the question group placeholder this becomes the place holder for the question text, but question group placeholder also accepts question text elements where the problem appears.</p> <p>Problem is that when there are two place holders: <code>question-group-placeholder</code> and <code>question-placeholder</code> when I am dragging the text element both events are invoked and I see two alerts which makes sense because they both accepts <code>question-text</code> elements. What I am trying to achieve is if I am dragging question text to a specific placeholder it will only end up on this place holder, not on all of them. Is there any way this can be done?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload