Can't drag list item inside of unordered list
Question
Ciao, spero che stai bene e grazie per GrapesJS! I am trying to create a way for users to create multiple choice questions. The first block below is the section that has a form with an unordered list inside of it. The unordered-list inside of the form should be able to accept a list item, which is another block in itself (the second block below). I am getting this error: "Invalid target position: Target collection not found, Target is not droppable...". I have set the data-gjs-draggable and data-gjs-droppable, so I am not sure why it is not working correctly. Any help would be much appreciated.
<section
id="multiple-choice-question-text"
class="theme-bg-1"
data-gjs-type="dynamicOptions"
data-gjs-style-class="true"
data-gjs-removable="true"
data-gjs-editable="true"
data-gjs-parent-slide="true"
data-gjs-slide-template="multiple-choice-question-text"
data-gjs-draggable="#wrapper"
data-gjs-highlightable="true"
data-gjs-custom-name="Slide"
data-gjs-stylable="<?php echo $gjsconfig['stylable']['background']?>"
data-gjs-sectionID="<?php echo (isset($sectionData['id'])) ? $sectionData['id'] : ''; ?>">
<div
data-gjs-editable="false"
data-gjs-droppable="false"
data-gjs-draggable="false"
data-gjs-removable="false"
data-gjs-stylable="false"
data-gjs-highlightable="false"
data-gjs-copyable="false">
<!-- START: SLIDE CONTENT -->
<form
data-gjs-sectionID="<?php echo (isset($sectionData['id'])) ? $sectionData['id'] : ''; ?>"
class="multiple-choice-text-form"
method="post"
data-gjs-droppable="false"
data-gjs-draggable="false">
<!-- Question -->
<?php require("components/multiple-choice-question.ctp"); ?>
<!-- Answer Section -->
<ul
class="mc-option-list"
id="question-answers"
class="answer-section"
data-gjs-editable="false"
data-gjs-droppable=".mc-option"
data-gjs-draggable="false"
data-gjs-removable="false"
data-gjs-stylable="false"
data-gjs-highlightable="true"
data-gjs-copyable="false">
<!-- Answers/Options Go Here Dynamically. One is provided by default though. -->
<?php require("components/multiple-choice-option.ctp"); ?>
</ul>
<input
data-gjs-editable="false"
data-gjs-droppable="false"
data-gjs-draggable="false"
data-gjs-removable="false"
data-gjs-stylable="false"
data-gjs-highlightable="false"
data-gjs-copyable="false"
type="submit"
name="submit"
value="Submit">
<!-- END: SLIDE CONTENT -->
</form>
</div>
</section>
<li
class="radio mc-option"
data-gjs-stylable="false"
data-gjs-highlightable="true"
data-gjs-editable="false"
data-gjs-droppable="false"
data-gjs-draggable=".mc-option-list"
data-gjs-removable="true"
data-gjs-copyable="false">
<input
type="radio"
name="answersRadios"
id="answersRadios"
value="answersRadios"
data-gjs-editable="false"
data-gjs-droppable="false"
data-gjs-draggable="false"
data-gjs-removable="false"
data-gjs-copyable="false"
data-gjs-stylable="false"
data-gjs-highlightable="false"/>
<label
class="theme-text-1"
for="answersRadios"
data-gjs-style-class="true"
data-gjs-stylable="<?php echo $gjsconfig['stylable']['text']?>"
data-gjs-editable="true"
data-gjs-droppable="false"
data-gjs-draggable="false"
data-gjs-removable="false"
data-gjs-copyable="false"
data-gjs-fieldtype="text"
data-gjs-saveable="true"
data-gjs-sectionID="<?php echo (isset($sectionData['lesson_plan_slide_sections'][1]['id'])) ? $sectionData['lesson_plan_slide_sections'][1]['id'] : ''; ?>">
<?php echo (isset($sectionData['lesson_plan_slide_sections'][1]['content'])) ? trim($sectionData['lesson_plan_slide_sections'][1]['content']) : $content[1]; ?>
</label>
</li>
Answers (3)
Hi @NicholasGati I think it might be an issue with data-gjs-stylable="false" can you try to remove it from <ul> and <li> and check if it works
Hey @artf, thanks for replying. I removed data-gjs-stylable="false" and it still does not work. I get the same error: 'Target collection not found, Target is not droppable...'.
Are you able to reproduce it by using something like jsfiddle/codesandbox?
Related Questions and Answers
Continue research with similar issue discussions.
Issue #1707
Find images links in the editor
I am trying to integrate GrapesJs in reactJs. Can you please help me out with the below question w.r.t GrapesJs-React, • Is there a way to...
Issue #1789
[Question] How to append a plus icon in the column and element section?
Hi @artf . First of all, great work. I have been trying to use grapesjs for a month now. So, I stumbled upon a situation where I need to le...
Issue #1547
How to add component attributes (before rendering)
Hello, I'm looking to auto create components inside a block element and it seems that I manage to do that but with a small missing... How I...
Issue #1965
Custom content type
@artf Instead of using plugins js files, can we create our own content using html as I have done below. Is it a correct way to do it? Sorry...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.