angular-sortable-view icon indicating copy to clipboard operation
angular-sortable-view copied to clipboard

display wrong option when used with select

Open dozie opened this issue 7 years ago • 1 comments
trafficstars

I have some items which contains some select options in them. When moving the row, the items in the select input field always resets to the first option until the element has been moved to its new spot.

Here's a piece of what I have

<ul class="session-table" sv-root sv-part="columns" sv-on-sort="sort($item, $partFrom, $partTo, $indexFrom, $indexTo)"
     sv-on-start="start($item, $part, $index, $helper)">
    <li class="list-grid" ng-repeat="(index, col) in columns" sv-element>
        <div class="session-row">
            <div class="session-rowcontent">
                <span class="session-grid-dots" sv-handle></span>
                <input type="text" class="ffl-session-value ffl-text" value=""
                    ng-model="col.label"
                    ng-class="{'text-empty': !col.label, 'text-not-empty': col.label}"/>

                <select class="preview-select dropdown"
                    ng-model="col.field"
                    ng-class='{"dropdown-empty": !col.field, "dropdown": col.field, "col-field-error": col.error}'>
                        <option ng-repeat="field in fields" value="{{field}}">{{field}}</option>
                </select>
            </div>
        </div>
    </li>
</ul>

dozie avatar Jan 01 '18 03:01 dozie

i confirm this issue in the current version.

and similar to this I can add: if you have radio-buttons in your sv-element, the current selection of the radio-button will vanish in the moment you drop the element (no matter if the order changed). although in the model the correct value of the radio-button ist kept, and if you trigger a redraw of the buttons (e.g. by ng-hide/ng-show -ing the container of the radio-buttons) the selection is back.

jannis701 avatar Jun 30 '21 13:06 jannis701