[Bps-public-commit] rt-extension-formtools branch dynamic-forms-from-config updated. 0.53-107-gf69de59

BPS Git Server git at git.bestpractical.com
Tue Nov 14 23:43:20 UTC 2023


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "rt-extension-formtools".

The branch, dynamic-forms-from-config has been updated
       via  f69de59afbd7fd7db0cbd04983f840c7a7d0b6a1 (commit)
      from  1cab2e2a139638b8e54d0674a6a5ccab93073f90 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit f69de59afbd7fd7db0cbd04983f840c7a7d0b6a1
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Tue Nov 14 18:41:10 2023 -0500

    Refresh selectpicker after changing select options
    
    Some browsers(e.g. Safari) init selectpicker earlier than others, thus
    we need to manually sync selectpicker after changes of select inputs.

diff --git a/html/Forms/dhandler b/html/Forms/dhandler
index 831b6ef..8b494dc 100644
--- a/html/Forms/dhandler
+++ b/html/Forms/dhandler
@@ -60,7 +60,7 @@ jQuery(function () {
                 if ( !elem.find('select.selectpicker option[selected]').length ) {
                     elem.find('select.selectpicker').val(null); // Do not automatically select the first valid option
                 }
-                elem.find('select.selectpicker').attr('required', true);
+                elem.find('select.selectpicker').attr('required', true).selectpicker('refresh');
             }
             else if ( elem.find('input[type=radio]').length ) {
                 elem.find('input[type=radio][value=""]').closest('div.custom-control').remove();

-----------------------------------------------------------------------

Summary of changes:
 html/Forms/dhandler | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


hooks/post-receive
-- 
rt-extension-formtools


More information about the Bps-public-commit mailing list