rniemeyer / knockout-sortable

A Knockout.js binding to connect observableArrays with jQuery UI sortable functionality
MIT License
547 stars 128 forks source link

Template whitespace stripping not working when template name is a function #144

Open rniemeyer opened 9 years ago

Manuel-S commented 9 years ago

I've stumbled over this, too, since the notes on the readme said that it should work.

Manuel-S commented 9 years ago

I tried messing around a bit but couldn't get it to work so far, any ideas?

Manuel-S commented 9 years ago

For the time being I have made a workaround, setting a list of templatenames to clean in the binding options.

After line 126:

            if (typeof templateOptions.name == "function" && value.prepareTemplates instanceof Array) {
                for (var i = 0; i < value.prepareTemplates.length; i++) {
                    stripTemplateWhitespace(element, value.prepareTemplates[i]);
                }
            }

then use sortable: {... , prepareTemplates: ['template1id', 'template2id']}

JasperTey commented 4 years ago

I just encountered this, and I see it's an open issue from 2015... what are the chances that there'll be an official fix for this anytime soon? fingers crossed

rniemeyer commented 4 years ago

@JasperTey - I'll see if I can take a look at the issue.