diff --git a/src/components/input-counter/index.ts b/src/components/input-counter/index.ts index e6715cd49..8fa1ef5d0 100644 --- a/src/components/input-counter/index.ts +++ b/src/components/input-counter/index.ts @@ -197,22 +197,15 @@ export function initInputCounters() { // check if the target element exists if ($targetEl) { - if ( - !instances.instanceExists( - 'InputCounter', - $targetEl.getAttribute('id') - ) - ) { - new InputCounter( - $targetEl as HTMLInputElement, - $incrementEl ? ($incrementEl as HTMLElement) : null, - $decrementEl ? ($decrementEl as HTMLElement) : null, - { - minValue: minValue ? parseInt(minValue) : null, - maxValue: maxValue ? parseInt(maxValue) : null, - } as InputCounterOptions - ); - } + new InputCounter( + $targetEl as HTMLInputElement, + $incrementEl ? ($incrementEl as HTMLElement) : null, + $decrementEl ? ($decrementEl as HTMLElement) : null, + { + minValue: minValue ? parseInt(minValue) : null, + maxValue: maxValue ? parseInt(maxValue) : null, + } as InputCounterOptions + ); } else { console.error( `The target element with id "${targetId}" does not exist. Please check the data-input-counter attribute.`