-
Notifications
You must be signed in to change notification settings - Fork 1k
Allow default unit to be added to spinbox if not present #1492
Allow default unit to be added to spinbox if not present #1492
Conversation
since spinboxes do not traditionally use spaces within our applications
Updated with non-allowed default unit test. I am not adding null. Non-strings should not be used, nor accounted for. For instance |
6e65aa7
to
c949605
Compare
c949605
to
b5b1b26
Compare
Updated. Thanks. |
// if set and default unit if not already present, | ||
// and is an allowed unit, then add default unit | ||
if (this.options.defaultUnit !== '' && | ||
this.options.defaultUnit !== value.slice(-2) && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'll probably want to adjust this to account for units longer than 2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refresh the page.
Please add a unit test for some unit/default unit combo that is 3+ digits and increments the spinbox at least once. |
@cmcculloh Added test that uses |
Also tests support for 3 character default unit
6795398
to
a78f6f2
Compare
Allow default unit to be added to spinbox if not present
I'd call this a bug, since I think spinbox was meant to work this way, but it is a new initialization option.
Fixes #1490.