Skip to content

[ASK] Disable position of disabled sortable item #20

@alkunjo

Description

@alkunjo

Can we disable the position of disabled sortable item using this component? For example I have this snippet:

<sortable-list sortable=".mcItem" id="mcList" on-items-changed="itemsOrder">
  <paper-item class="mcItem" value="[[dataMcTrendCross.rows.0.id]]" disabled="true">
    <div class="col m10">[[dataMcTrendCross.rows.0.MenuCategory.name]]</div>
  </paper-item>
  <template is="dom-repeat" items="[[dataMc.rows]]" as="mc">
    <paper-item class="mcItem" value="[[mc.id]]">
      <div class="col m10">[[mc.MenuCategory.name]]</div>
      <div class="col m2">
        <paper-icon-button icon="delete" id="[[mc.id]]" on-click="deleteMc" value="[[mc.id]]"></paper-icon-button>
      </div>
    </paper-item>
  </template>
  <paper-item class="mcItem" value="[[dataMcTrendCross.rows.1.id]]" disabled="true">
    <div class="col m10">[[dataMcTrendCross.rows.1.MenuCategory.name]]</div>
  </paper-item>
</sortable-list>

On that code, I already disabled the first and the last paper-items so those can't be dragged. But somehow the other paper-items inside the dom-repeat still can be dragged and replace the disabled paper-items position. How would I disable the position of the disabled paper-items so another active paper-items can't replace their position?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions