arteyazilim / rowsorter

Drag & drop table row sorter pluging with touch support for Vanilla JS and jQuery.
http://borayazilim.github.io/rowsorter
MIT License
74 stars 23 forks source link

Problem with Form Fields. #14

Open sipi41 opened 8 years ago

sipi41 commented 8 years ago

Hi, I have a table inside a form, in each row I have a couple of text fields.

When I click the form field inside the table row, it just ignore that I want to write inside... in other words, I'm unable to use a combobox and/or an input box... is there a way to fix this?? please advise.

Thank you! awesome (if this can be fixed)

sinanislekdemir commented 7 years ago

I know, it is a bit late for your case but I also encountered the same problem and solved it by editing the "mousedown" function a little. The problem is preventDefault() also prevents the inputs to be active. So in my case, I had my input "text" fields so I just wrote the code to work with "text" fields just like below. All I did was to check the ev.srcElement.type property; So the result is as below if it helps.

In my case, my form had "text"


function mousedown(ev)
    {
        ev = ev || window.event;
        if (this._start(ev.target || ev.srcElement, ev.clientY)) {
            if (ev.preventDefault) {
                if(ev.srcElement.type != "text"){
                    ev.preventDefault();
                }
            } else {
                ev.returnValue = false;
            }
            return false;
        }
        return true;
    }`

Sorry for the English btw.