jQuery-Plugins icon indicating copy to clipboard operation
jQuery-Plugins copied to clipboard

Preventing negative numbers

Open searls opened this issue 14 years ago • 3 comments

On my project, we very often need to restrain users to positive numbers, so I changed numeric() to take an object literal. Another change I might make in the future is another option to universally allow a keystroke if a modifier key (i.e. alt/ctrl/cmd) is held down.

I realize that this signature change would break backwards compatibility, but I think the object literal with an explicit config would make the options more apparent to users (I got stuck trying to declare no decimal by specifying '' at first).

searls avatar Dec 08 '10 13:12 searls

i did the same thing, would be good to see it in master

maniserowicz avatar Jan 09 '11 13:01 maniserowicz

Hi Sam, I just added this commit to try to ensure BC (check if the first param is a boolean and wrap it in the appropriate property of the new config object: https://github.com/searls/jQuery-Plugins/commit/a637a3a9f7d781813d58c0588140089a619570cd

searls avatar Jan 31 '11 02:01 searls

Is this still planned for a major revision?

drewfreyling avatar Jul 09 '12 13:07 drewfreyling