bootstrap-input-spinner 5.0.0 → 5.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/package.json +1 -1
- package/test/TestInputSpinner.js +31 -0
package/README.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
A Bootstrap 5 extension to create input spinner elements for number input. Zero dependencies other than Bootstrap 5 — **no jQuery required** since v5.0.0.
|
|
4
4
|
|
|
5
|
+
> **Unofficial third-party component** — `bootstrap-input-spinner` is maintained by [shaack.com](https://shaack.com) and is not affiliated with or endorsed by the Bootstrap team.
|
|
6
|
+
|
|
5
7
|
> Note: bootstrap-input-spinner is now an ES6 module. The legacy ES5 version has been removed; if you still need it, pin to npm `3.x`. If you still need jQuery integration, pin to `4.x`.
|
|
6
8
|
|
|
7
9
|

|
package/package.json
CHANGED
package/test/TestInputSpinner.js
CHANGED
|
@@ -208,6 +208,37 @@ describe("InputSpinner events", () => {
|
|
|
208
208
|
})
|
|
209
209
|
})
|
|
210
210
|
|
|
211
|
+
describe("InputSpinner instance isolation", () => {
|
|
212
|
+
it("stepping one spinner does not fire change on another (regression for #121)", async () => {
|
|
213
|
+
const elA = createInput({value: "5", min: "0", max: "10", step: "1"})
|
|
214
|
+
const elB = createInput({value: "5", min: "0", max: "10", step: "1"})
|
|
215
|
+
new InputSpinner(elA)
|
|
216
|
+
new InputSpinner(elB)
|
|
217
|
+
let a = 0, b = 0
|
|
218
|
+
elA.addEventListener("change", () => a++)
|
|
219
|
+
elB.addEventListener("change", () => b++)
|
|
220
|
+
pressButton(elA.nextElementSibling.querySelector(".btn-increment"))
|
|
221
|
+
await wait()
|
|
222
|
+
assert.equal(a, 1)
|
|
223
|
+
assert.equal(b, 0)
|
|
224
|
+
clear()
|
|
225
|
+
})
|
|
226
|
+
it("stepping one spinner does not fire input on another", async () => {
|
|
227
|
+
const elA = createInput({value: "5", min: "0", max: "10", step: "1"})
|
|
228
|
+
const elB = createInput({value: "5", min: "0", max: "10", step: "1"})
|
|
229
|
+
new InputSpinner(elA)
|
|
230
|
+
new InputSpinner(elB)
|
|
231
|
+
let a = 0, b = 0
|
|
232
|
+
elA.addEventListener("input", () => a++)
|
|
233
|
+
elB.addEventListener("input", () => b++)
|
|
234
|
+
pressButton(elA.nextElementSibling.querySelector(".btn-increment"))
|
|
235
|
+
await wait()
|
|
236
|
+
assert.true(a >= 1)
|
|
237
|
+
assert.equal(b, 0)
|
|
238
|
+
clear()
|
|
239
|
+
})
|
|
240
|
+
})
|
|
241
|
+
|
|
211
242
|
describe("InputSpinner attribute observation", () => {
|
|
212
243
|
it("reflects min/max changes", async () => {
|
|
213
244
|
const {el} = spin({value: "5", min: "0", max: "10"})
|