Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draggable Incorrectly calls template init/update #186

Open
rposener opened this issue May 18, 2017 · 0 comments
Open

Draggable Incorrectly calls template init/update #186

rposener opened this issue May 18, 2017 · 0 comments

Comments

@rposener
Copy link

rposener commented May 18, 2017

When using draggable binding, it incorrectly uses template binding, but does not need to control the contents. This becomes an issue as it changes the context, and removes named items. Consider this example:

<tbody data-bind="foreach:{data:staff, as:'st'}">
    <tr>
        <th data-bind="text:st.Name"></th>
        <!-- ko foreach:{data:weeks, as:'wk'} -->
        <td data-bind="droppable:$component.dropTo.bind($component, {staff:st, week:wk})">
            <div data-bind="draggable:{staff:st, week:wk}">
                <span data-bind="text:$component.getCell.bind($component, {staff:st, week:wk})"></span>
            </div>
        </td>
        <!-- /ko -->
    </tr>
</tbody>

The span in here does not work, due to the template use in the draggable. I cannot see a valid reason for it in other cases. Will submit a pull request with this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant