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

How to pass an extra parameter to the decrement and increment button? #129

Open
Brecht272727 opened this issue Nov 15, 2024 · 0 comments
Open

Comments

@Brecht272727
Copy link

Brecht272727 commented Nov 15, 2024

I use your input-spinner in a cart with different items. But i need to know how i can pass a parameter like data-id=... to the buttons.
After that i am able to decrease or increase the quantity of that specific product in the cart.
I am using the template in the props.

				var props = {
						autoDelay: 500, // ms threshold before auto value change
						autoInterval: 50, // speed of auto value change, set to `undefined` to disable auto-change
						buttonsOnly: true, // set this `true` to disable the possibility to enter or paste the number via keyboard
						keyboardStepping: true, // set this to `false` to disallow the use of the up and down arrow keys to step
						template: // the template of the input
								'<div class="input-group ${groupClass}">' +
								'<button style="min-width: ${buttonsWidth}" class="btn btn-decrement ${buttonsClass} btn-minus" type="button">${decrementButton}</button>' +
								'<input type="text" inputmode="decimal" style="text-align: ${textAlign}; box-shadow: none; width: 20% !important;" class=""/>' +
								'<button style="min-width: ${buttonsWidth}" class="btn btn-increment ${buttonsClass} btn-plus" type="button">${incrementButton}</button>' +
								'</div>'				
				};
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

1 participant