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

Wrong behavior if min value is set #12

Open
em286 opened this issue Sep 4, 2011 · 1 comment
Open

Wrong behavior if min value is set #12

em286 opened this issue Sep 4, 2011 · 1 comment

Comments

@em286
Copy link

em286 commented Sep 4, 2011

A have a spinnerred textbox:
$('#txtbox').spinner({'min' : 5});

When I mousedown the 'down' arrow for a second I have the value of the textbox set to 0, which is wrong. It seems to me that I fixed this by changing '_spin' function like that:

_spin: function(dir, large) {
        // shortcuts
        var self = this,
            increment = self.options.increment,
            curIncrement = increment[self.incCounter];

        self._change(); // <<<<<<<<THIS WAS ADDED BY ME
        self._doSpin(dir * curIncrement.mult * (large ? self.options.largeStep : self.options.step));
        self.counter++;

        if ((self.counter > curIncrement.count) && (self.incCounter < increment.length-1)) {
            self.counter = 0;
            curIncrement = increment[++self.incCounter];
            self._setTimer(curIncrement.delay, dir, large);
        }
    },
@dannya
Copy link

dannya commented Dec 6, 2012

I confirm that this works and fixes the issue, suggest merging it into master.

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

2 participants