From d8af4df36db4fe9a6b9e511529a349cdec34f4e1 Mon Sep 17 00:00:00 2001 From: Pawan Kumar Date: Thu, 4 Jan 2024 14:58:03 +0530 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20new(slider):=20slider=20field=20ini?= =?UTF-8?q?t=20issue=20fix.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/js/slider.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/library/js/slider.js b/library/js/slider.js index b867dc9c..dddff181 100644 --- a/library/js/slider.js +++ b/library/js/slider.js @@ -32,6 +32,11 @@ // Get the label associated with this slider var $label = $( 'label[for="' + $input.attr( 'id' ) + '"]' ); + // Check if slider is already intialised. + if ( true === $slide.data( 'init' ) ) { + return; + } + // Initialize the slider with the parsed values $slide.slider({ range: $isRange ? true : 'min', @@ -46,6 +51,9 @@ var $formattedValue = valueTemplate( $element, $value ); var $formattedValueMax = $isRange ? valueTemplate( $element, $valueMax ) : null; + // add data-attribute to check intialization. + $slide.data( 'init', true ); + $sliderValueWrapper.find( '.forminator-slider-hidden-min' ).val( $value ).change(); if ( $isRange ) {