diff --git a/classes/views/styles/_buttons.php b/classes/views/styles/_buttons.php index 6337b46a18..6ceb11d317 100644 --- a/classes/views/styles/_buttons.php +++ b/classes/views/styles/_buttons.php @@ -53,7 +53,8 @@ class="frm-style-item-heading">
@@ -147,7 +148,8 @@ class="frm-style-item-heading">
@@ -183,7 +185,8 @@ class="frm-style-item-heading">
diff --git a/classes/views/styles/_check-box-radio-fields.php b/classes/views/styles/_check-box-radio-fields.php index 94e602c663..c36c7b7d40 100644 --- a/classes/views/styles/_check-box-radio-fields.php +++ b/classes/views/styles/_check-box-radio-fields.php @@ -23,7 +23,8 @@ class="frm-style-item-heading">
diff --git a/classes/views/styles/_field-colors.php b/classes/views/styles/_field-colors.php index 2cb662bba4..d2615af1b4 100644 --- a/classes/views/styles/_field-colors.php +++ b/classes/views/styles/_field-colors.php @@ -75,7 +75,8 @@ class="frm-style-item-heading">
@@ -309,7 +310,8 @@ class="frm-style-item-heading">
diff --git a/classes/views/styles/_field-description.php b/classes/views/styles/_field-description.php index a2b0134d15..abb54e5aef 100644 --- a/classes/views/styles/_field-description.php +++ b/classes/views/styles/_field-description.php @@ -23,7 +23,8 @@ class="frm-style-item-heading">
diff --git a/classes/views/styles/_field-labels.php b/classes/views/styles/_field-labels.php index fa476ee687..eaea6375a1 100644 --- a/classes/views/styles/_field-labels.php +++ b/classes/views/styles/_field-labels.php @@ -37,7 +37,8 @@ class="frm-style-item-heading">
@@ -109,7 +110,8 @@ class="frm-style-item-heading">
diff --git a/classes/views/styles/_field-sizes.php b/classes/views/styles/_field-sizes.php index 5da73a0cf1..bda970e10a 100644 --- a/classes/views/styles/_field-sizes.php +++ b/classes/views/styles/_field-sizes.php @@ -5,7 +5,8 @@ ?>
@@ -41,7 +42,8 @@ class="frm-style-item-heading">
@@ -58,7 +60,8 @@ class="frm-style-item-heading">
@@ -111,7 +114,8 @@ class="frm-style-item-heading">
diff --git a/classes/views/styles/_form-description.php b/classes/views/styles/_form-description.php index 6e834f0d38..1589827a56 100644 --- a/classes/views/styles/_form-description.php +++ b/classes/views/styles/_form-description.php @@ -6,7 +6,8 @@
diff --git a/classes/views/styles/_form-messages.php b/classes/views/styles/_form-messages.php index 23211b0752..749d2c5e1a 100644 --- a/classes/views/styles/_form-messages.php +++ b/classes/views/styles/_form-messages.php @@ -73,7 +73,8 @@ class="frm-style-item-heading">
@@ -149,7 +150,8 @@ class="frm-style-item-heading">
diff --git a/classes/views/styles/_form-title.php b/classes/views/styles/_form-title.php index 0b1f34cc5c..fe9cb8253b 100644 --- a/classes/views/styles/_form-title.php +++ b/classes/views/styles/_form-title.php @@ -23,7 +23,8 @@ class="frm-style-item-heading">
diff --git a/classes/views/styles/_general.php b/classes/views/styles/_general.php index 5508b9d080..37c61b94d7 100644 --- a/classes/views/styles/_general.php +++ b/classes/views/styles/_general.php @@ -65,7 +65,8 @@ class="frm-style-item-heading">
@@ -102,7 +103,8 @@ class="frm-style-item-heading">
diff --git a/classes/views/styles/_quick-settings.php b/classes/views/styles/_quick-settings.php index a86ece648e..9c3f6f71a9 100644 --- a/classes/views/styles/_quick-settings.php +++ b/classes/views/styles/_quick-settings.php @@ -161,7 +161,8 @@ class="frm-style-item-heading">
@@ -207,7 +208,8 @@ class="frm-style-item-heading">
diff --git a/tests/cypress/e2e/Styles/styleLabelFocusTargets.cy.js b/tests/cypress/e2e/Styles/styleLabelFocusTargets.cy.js index d0e798715e..3e268ed6d9 100644 --- a/tests/cypress/e2e/Styles/styleLabelFocusTargets.cy.js +++ b/tests/cypress/e2e/Styles/styleLabelFocusTargets.cy.js @@ -30,6 +30,33 @@ describe( 'Style builder labels focus their visible/interactive control', () => cy.focused().should( 'have.id', 'frm_fieldset-value' ); } ); + it( 'A slider label outside Width/Height also drops its focus target once its unit is cleared to "Not set"', () => { + cy.intercept( 'POST', '**/admin-ajax.php', req => { + if ( req.body?.includes( 'action=frm_change_styling' ) ) { + req.alias = 'changeStyling'; + } + } ); + + cy.visit( '/wp-admin/admin.php?page=formidable-styles§ion=advanced-settings' ); + cy.get( '#general-style' ).should( 'have.class', 'open' ); + + cy.log( '"Border Width" (frm_fieldset) ships with a measured default, so the label starts wired up' ); + cy.get( '[data-slider-label-for="frm_fieldset-value"]' ).should( 'have.attr', 'for', 'frm_fieldset-value' ); + + cy.log( 'Clearing the unit to "Not set" disables the value input and drops the label\'s focus target' ); + cy.get( '#frm_fieldset' ).closest( '.frm-slider-component' ).find( '.frm-slider-value select' ).select( '' ); + cy.wait( '@changeStyling', { timeout: 10000 } ); + cy.get( '#frm_fieldset-value' ).should( 'be.disabled' ); + cy.get( '[data-slider-label-for="frm_fieldset-value"]' ).should( 'not.have.attr', 'for' ); + + cy.log( 'Choosing a measured unit again re-associates the label with the now-enabled input' ); + cy.get( '#frm_fieldset' ).closest( '.frm-slider-component' ).find( '.frm-slider-value select' ).select( 'px' ); + cy.wait( '@changeStyling', { timeout: 10000 } ); + cy.get( '[data-slider-label-for="frm_fieldset-value"]' ).should( 'have.attr', 'for', 'frm_fieldset-value' ); + cy.get( '[data-slider-label-for="frm_fieldset-value"]' ).click(); + cy.focused().should( 'have.id', 'frm_fieldset-value' ); + } ); + it( 'A "Width"/"Height" label targets nothing while its unit defaults to "auto", and gets a working focus target once a measured unit is chosen', () => { cy.intercept( 'POST', '**/admin-ajax.php', req => { if ( req.body?.includes( 'action=frm_change_styling' ) ) {