Skip to content

Instantly share code, notes, and snippets.

@pbiron
Created September 12, 2021 21:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pbiron/31f9cb564ae7e237340398e46182438f to your computer and use it in GitHub Desktop.
Save pbiron/31f9cb564ae7e237340398e46182438f to your computer and use it in GitHub Desktop.
Patch for Gravity Forms 2.5.10 bug where date fields with datepickers within a repeater don't initialize the datepicker when the field on when a new repeat is added by the user
From 0f3fe93e4c7b82cf625e30b49db7b43ea1b46704 Mon Sep 17 00:00:00 2001
From: Paul Biron <paul@sparrowhawkcomputing.com>
Date: Sun, 12 Sep 2021 15:53:13 -0600
Subject: [PATCH] Fix bug that causes subsequent repeats of date fields that
use a datepicker from showing the jQuery datepicker.
---
js/gravityforms.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/js/gravityforms.js b/js/gravityforms.js
index 8f85fa3..f9b8e84 100644
--- a/js/gravityforms.js
+++ b/js/gravityforms.js
@@ -1725,7 +1725,7 @@ function gformAddRepeaterItem( addButton, max ) {
if ( typeof gformInitDatepicker == 'function' ) {
$container.find('.ui-datepicker-trigger').remove();
- $container.find('.hasDatepicker').removeClass('hasDatepicker');
+ $container.find('.initialized').removeClass('initialized');
gformInitDatepicker();
}
--
2.30.2.windows.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment