Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
ca9cb12
Add aria-describedby attribute where missing for fields with error
AbdiTolesa Nov 10, 2025
603d9b1
Cover remaining fields that miss aria-describedby when field errors
AbdiTolesa Nov 10, 2025
60c34ef
Remove aria-describedby atts from elements with no errors
AbdiTolesa Nov 10, 2025
39cf3ed
Try fixing Workflow errors
AbdiTolesa Nov 11, 2025
32c726c
Try fixing Workflow errors
AbdiTolesa Nov 11, 2025
2058760
Try fixing Workflow errors
AbdiTolesa Nov 11, 2025
e1970fb
Fix warnings
AbdiTolesa Nov 18, 2025
272d808
Fix static analysis warning
AbdiTolesa Nov 18, 2025
b6faf96
Make sure frm_include_alert_role_on_field_errors can be used to remov…
AbdiTolesa Nov 20, 2025
4bed2cd
Fix condition check to remove role='alert'
AbdiTolesa Nov 20, 2025
ec5d850
Correct check for role='alert' in an html
AbdiTolesa Nov 20, 2025
4482d15
Improve code reliability
AbdiTolesa Nov 21, 2025
74f8a6c
Ignore PHPStan false positive
AbdiTolesa Nov 21, 2025
2b43dd8
Remove PHPStan ignore line to suppress warning
AbdiTolesa Nov 21, 2025
4228669
Reuse existing variable
AbdiTolesa Nov 28, 2025
5234a55
Undo last change
AbdiTolesa Nov 28, 2025
f81936d
Merge branch 'master' into issue-6068-fix_checkbox_and_radio_buttons_…
Crabcyborg Dec 1, 2025
d09ccd1
Merge branch 'master' into issue-6068-fix_checkbox_and_radio_buttons_…
Crabcyborg Dec 1, 2025
d2c44e5
Fix potential bug and workflow errors
AbdiTolesa Dec 2, 2025
02d6728
Commit before merge
AbdiTolesa Dec 2, 2025
4a70eaa
Fix potential bug and workflow errors
AbdiTolesa Dec 2, 2025
adc91f5
Fix invalid function return statement
AbdiTolesa Dec 2, 2025
92a69e9
Resolve conflict with master
AbdiTolesa Dec 2, 2025
09febfe
Resolve conflict with master
AbdiTolesa Dec 2, 2025
9a43d8d
Resolve conflict with master
AbdiTolesa Dec 2, 2025
2f40d11
Fix all merge conflicts
AbdiTolesa Dec 2, 2025
81c1f09
Fix all merge conflicts
AbdiTolesa Dec 2, 2025
2f7b19b
Fix remaining merge conflict
AbdiTolesa Dec 2, 2025
10a587d
Build files
AbdiTolesa Dec 2, 2025
ce3b9c6
Use attribut tokenization to implement set/unset aria-describedby
AbdiTolesa Dec 2, 2025
80d9070
Fix merge conflict
AbdiTolesa Dec 2, 2025
58e1328
Merge branch 'master' into issue-6068-fix_checkbox_and_radio_buttons_…
Crabcyborg Dec 3, 2025
933de3f
Go back to using $add_html
Crabcyborg Dec 3, 2025
ee00f36
Go back to using $html and unset $add_html
Crabcyborg Dec 3, 2025
e9ce506
Simplify js code further
AbdiTolesa Dec 3, 2025
9208e5a
Merge branch 'issue-6068-fix_checkbox_and_radio_buttons_accessibility…
AbdiTolesa Dec 3, 2025
eaf7d0e
Return early when there are no errors
AbdiTolesa Dec 3, 2025
86ed330
Move out logic in foreach block into a new function
AbdiTolesa Dec 4, 2025
a428c47
Fix FrmFieldFormHtml.php blank_line_before_statement rule
AbdiTolesa Dec 4, 2025
1360c0b
Possible php cs fixer fix
Crabcyborg Dec 4, 2025
90d084e
Merge branch 'master' into issue-6068-fix_checkbox_and_radio_buttons_…
Crabcyborg Dec 4, 2025
e26b042
Filter out empty ariaDescribedBy values
AbdiTolesa Dec 4, 2025
732cde4
Merge branch 'issue-6068-fix_checkbox_and_radio_buttons_accessibility…
AbdiTolesa Dec 4, 2025
02e8f58
Fix merge conflict and merge master
AbdiTolesa Dec 4, 2025
6b1c15c
Make sure ariaDescribedBy attribute is set when error occurs in JS va…
AbdiTolesa Dec 4, 2025
d6bf75e
Fix all eslint errors
AbdiTolesa Dec 4, 2025
8962fd3
Merge branch 'master' into issue-6068-fix_checkbox_and_radio_buttons_…
Crabcyborg Dec 8, 2025
e4c79ba
Merge branch 'master' into issue-6068-fix_checkbox_and_radio_buttons_…
Crabcyborg Dec 8, 2025
4e7bf1f
Make sure aria-describedby is set when using ajax submission
AbdiTolesa Dec 9, 2025
c55910d
Merge master
AbdiTolesa Dec 9, 2025
c728c84
Merge branch 'master' into issue-6068-fix_checkbox_and_radio_buttons_…
Crabcyborg Dec 11, 2025
6feac4f
Merge branch 'master' into issue-6068-fix_checkbox_and_radio_buttons_…
Crabcyborg Jan 5, 2026
31960b6
Trim value before comparison check
AbdiTolesa Jan 6, 2026
4e652e4
Fix merge conflicts
AbdiTolesa Jan 6, 2026
966aabe
Add missing space before parenth
AbdiTolesa Jan 6, 2026
0f42619
Merge branch 'master' into issue-6068-fix_checkbox_and_radio_buttons_…
Crabcyborg Jun 4, 2026
25bf4f6
Merge branch 'master' into issue-6068-fix_checkbox_and_radio_buttons_…
Crabcyborg Jun 4, 2026
66c11eb
Merge branch 'master' into issue-6068-fix_checkbox_and_radio_buttons_…
Crabcyborg Jun 4, 2026
094d1f6
Go back to $add_html
Crabcyborg Jun 4, 2026
988f289
Try without passing around $args
Crabcyborg Jun 4, 2026
7d94ad7
Stop unsetting $add_html
Crabcyborg Jun 4, 2026
9882848
Use html ID if it is not empty
Crabcyborg Jun 4, 2026
8327f40
Simplify
Crabcyborg Jun 4, 2026
ab11eba
Revert change
Crabcyborg Jun 4, 2026
54db0b8
Remove extra since comment
Crabcyborg Jun 4, 2026
09c7780
Add a check for errors
Crabcyborg Jun 4, 2026
28b1302
Remove the errors check (required for descriptions to work)
Crabcyborg Jun 4, 2026
ea485a6
Merge branch 'master' into issue-6068-fix_checkbox_and_radio_buttons_…
Crabcyborg Jun 5, 2026
76af82b
Use inputs
Crabcyborg Jun 5, 2026
54b0317
Remove error from aria-describedby when error is removed, update aria…
Crabcyborg Jun 5, 2026
c44c35d
Use a better function name
Crabcyborg Jun 5, 2026
72e7110
Fix missing args issues
Crabcyborg Jun 5, 2026
60411cf
Add some guard clauses
Crabcyborg Jun 5, 2026
3994e11
Try to only call add aria description once
Crabcyborg Jun 5, 2026
a79552c
Revert hook changes
Crabcyborg Jun 5, 2026
a76eb3f
Revert scope change
Crabcyborg Jun 5, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions classes/models/FrmFieldFormHtml.php
Original file line number Diff line number Diff line change
Expand Up @@ -292,16 +292,26 @@ private function replace_error_shortcode() {
$this->maybe_add_error_id();
$error = $this->pass_args['errors'][ 'field' . $this->field_id ] ?? false;

if ( $error && ! str_contains( $this->html, 'role="alert"' ) && FrmAppHelper::should_include_alert_role_on_field_errors() ) {
if ( ! $error ) {
FrmShortcodeHelper::remove_inline_conditions( false, 'error', $error, $this->html );
return;
}
Comment thread
AbdiTolesa marked this conversation as resolved.

$include_alert_role_on_field_errors = FrmAppHelper::should_include_alert_role_on_field_errors();
Comment thread
AbdiTolesa marked this conversation as resolved.
$has_alert_role = str_contains( $this->html, 'role="alert"' );

if ( ! $has_alert_role && $include_alert_role_on_field_errors ) {
$error_body = self::get_error_body( $this->html );

if ( is_string( $error_body ) && ! str_contains( $error_body, 'role=' ) ) {
$new_error_body = preg_replace( '/class="frm_error/', 'role="alert" class="frm_error', $error_body, 1 );
$this->html = str_replace( '[if error]' . $error_body . '[/if error]', '[if error]' . $new_error_body . '[/if error]', $this->html );
}
} elseif ( ! $include_alert_role_on_field_errors && $has_alert_role ) {
$this->html = str_replace( 'role="alert"', '', $this->html );
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.

FrmShortcodeHelper::remove_inline_conditions( ! empty( $error ), 'error', $error, $this->html );
FrmShortcodeHelper::remove_inline_conditions( true, 'error', $error, $this->html );
}

/**
Expand Down
3 changes: 1 addition & 2 deletions classes/models/fields/FrmFieldTextarea.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,12 @@
*/
public function front_field_input( $args, $shortcode_atts ) {
$input_html = $this->get_field_input_html_hook( $this->field );
$this->add_aria_description( $args, $input_html );
$rows = $this->field['max'] ? 'rows="' . esc_attr( $this->field['max'] ) . '" ' : '';
$rows = $this->field['max'] ? 'rows="' . esc_attr( $this->field['max'] ) . '" ' : '';

Check warning on line 101 in classes/models/fields/FrmFieldTextarea.php

View workflow job for this annotation

GitHub Actions / Mago

possibly-invalid-array-access

Cannot perform array access on value of type `int`. >The expression might be `int` here. Attempting to use a scalar value as an array will result in a runtime error. Help: Ensure the variable holds an array before accessing it.

Check warning on line 101 in classes/models/fields/FrmFieldTextarea.php

View workflow job for this annotation

GitHub Actions / Mago

possibly-invalid-array-access

Cannot perform array access on value of type `object`. >The expression might be `object` here. Attempting to use a scalar value as an array will result in a runtime error. Help: Ensure the variable holds an array before accessing it.

// phpcs:disable Generic.WhiteSpace.ScopeIndent
return '<textarea name="' . esc_attr( $args['field_name'] ) . '" id="' . esc_attr( $args['html_id'] ) . '" ' .
$rows . $input_html . '>' .
FrmAppHelper::esc_textarea( $this->field['value'] ) .

Check warning on line 106 in classes/models/fields/FrmFieldTextarea.php

View workflow job for this annotation

GitHub Actions / Mago

possibly-invalid-array-access

Cannot perform array access on value of type `object`. >The expression might be `object` here. Attempting to use a scalar value as an array will result in a runtime error. Help: Ensure the variable holds an array before accessing it.
'</textarea>';
// phpcs:enable Generic.WhiteSpace.ScopeIndent
}
Expand Down
71 changes: 69 additions & 2 deletions classes/models/fields/FrmFieldType.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,18 @@ abstract class FrmFieldType {
*/
protected $array_allowed = true;

/**
* Whether the aria description has already been added to this field's
* inputs during the current render. Prevents a field type that adds it in
* its own front_field_input from having it added a second time by
* add_aria_description_to_inputs.
*
* @since x.x
*
* @var bool
*/
protected $aria_description_added = false;

/**
* @var bool|null Whether or not draft fields should be hidden on the front end.
*/
Expand Down Expand Up @@ -1155,17 +1167,70 @@ public function set_aria_invalid_error( &$shortcode_atts, $args ) {
* @return string
*/
public function include_front_field_input( $args, $shortcode_atts ) {
$this->aria_description_added = false;

if ( $this->include_front_form_file() ) {
$input = $this->include_on_front_form( $args, $shortcode_atts );
} else {
$input = $this->front_field_input( $args, $shortcode_atts );
}

$this->add_aria_description_to_inputs( $args, $input );
$this->load_field_scripts( $args );

return $input;
}

/**
* Link every input, select, and textarea in the field HTML to the field
* error and description for screen readers.
*
* Applying it here covers single-input fields and multi-input fields
* (checkboxes, radios) in one place, since both produce their final HTML
* through this method.
*
* @since x.x
*
* @param array $args Rendering context. May include `field_id`, `html_id` and `errors`.
* @param string $input_html Full field HTML. Passed by reference.
*
* @return void
*/
public function add_aria_description_to_inputs( $args, &$input_html ) {
if ( '' === $input_html || $this->aria_description_added ) {
// A front_field_input override (e.g. in Pro) already added it.
return;
}

if ( ! isset( $args['field_id'] ) ) {
$args['field_id'] = $this->get_field_column( 'id' );
}

if ( empty( $args['html_id'] ) ) {
$args['html_id'] = FrmFieldsHelper::get_html_id( $this->field );
}

if ( ! isset( $args['errors'] ) || ! is_array( $args['errors'] ) ) {
$args['errors'] = array();
}

$input_html = preg_replace_callback(
'/<(input|select|textarea)\b([^>]*?)(\s*\/?)>/i',
function ( $matches ) use ( $args ) {
// Hidden inputs are not announced to screen readers, so skip them.
if ( 'input' === strtolower( $matches[1] ) && preg_match( '/type\s*=\s*["\']hidden["\']/i', $matches[2] ) ) {
return $matches[0];
}

$atts = $matches[2];
$this->add_aria_description( $args, $atts );

return '<' . $matches[1] . $atts . $matches[3] . '>';
},
$input_html
);
}

/**
* @return string
*/
Expand Down Expand Up @@ -1219,7 +1284,6 @@ protected function include_on_front_form( $args, $shortcode_atts ) {
public function front_field_input( $args, $shortcode_atts ) {
$field_type = $this->html5_input_type();
$input_html = $this->get_field_input_html_hook( $this->field );
$this->add_aria_description( $args, $input_html );
$this->add_extra_html_atts( $args, $input_html );

return '<input type="' . esc_attr( $field_type ) . '" id="' . esc_attr( $args['html_id'] ) . '" name="' . esc_attr( $args['field_name'] ) . '" value="' . esc_attr( $this->prepare_esc_value() ) . '" ' . $input_html . '/>'; // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong
Expand Down Expand Up @@ -1528,9 +1592,10 @@ protected function get_field_input_html_hook( $field ) {
}

/**
* Link input to field description for screen readers
* Link input to field description for screen readers.
*
* @since 3.0
* @since x.x Function privacy changed from `protected` to `public`.
*
* @param array $args
* @param string $input_html
Expand Down Expand Up @@ -1575,6 +1640,8 @@ protected function add_aria_description( $args, &$input_html ) {
if ( ! $error_comes_first ) {
$input_html .= ' data-error-first="0"';
}

$this->aria_description_added = true;
}

/**
Expand Down
7 changes: 7 additions & 0 deletions classes/views/frm-fields/front-end/checkbox-field.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
* Extra line breaks show as space on the front-end when
* the form is double filtered and not minimized.
*
* @var array $field
* @var string $field_name
* @var bool $read_only
* @var string $html_id
* @var array|null $args
*
* @phpcs:disable Generic.WhiteSpace.ScopeIndent
*
* @since 6.30 Added `$hide_label`.
Expand Down Expand Up @@ -82,6 +88,7 @@
?><input type="checkbox" name="<?php echo esc_attr( $field_name ); ?>[<?php echo esc_attr( $other_opt ? $opt_key : '' ); ?>]" id="<?php echo esc_attr( $html_id ); ?>-<?php echo esc_attr( $opt_key ); ?>" value="<?php echo esc_attr( $field_val ); ?>"<?php

echo $checked . ' '; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped

do_action( 'frm_field_input_html', $field );

if ( $should_echo_disabled_att ) {
Expand Down
7 changes: 5 additions & 2 deletions classes/views/frm-fields/front-end/dropdown-field.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
/**
* @package Formidable
*
* @var array $field
* @var array $field
* @var array|null $args
*/

if ( ! defined( 'ABSPATH' ) ) {
Expand All @@ -24,7 +25,9 @@
if ( $read_only ) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Variable $read_only might not be defined


A variable has been used but not defined, which may result in warnings during program execution. This can also cause bugs since the intended usage scope of the variable is not known.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Variable $read_only might not be defined


A variable has been used but not defined, which may result in warnings during program execution. This can also cause bugs since the intended usage scope of the variable is not known.

?>
<select <?php do_action( 'frm_field_input_html', $field ); ?>>
<?php } else { ?>
<?php
} else {
?>
<select name="<?php echo esc_attr( $field_name ); ?>" id="<?php echo esc_attr( $html_id ); ?>" <?php do_action( 'frm_field_input_html', $field ); ?>>
<?php
}
Expand Down
6 changes: 6 additions & 0 deletions classes/views/frm-fields/front-end/radio-field.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
* Extra line breaks show as space on the front-end when
* the form is double filtered and not minimized.
*
* @var array $field
* @var string $field_name
* @var bool $read_only
* @var string $html_id
* @var array|null $args
*
* @phpcs:disable Generic.WhiteSpace.ScopeIndent
*
* @since 6.30 Added `$hide_label`.
Expand Down
54 changes: 35 additions & 19 deletions js/formidable.js
Original file line number Diff line number Diff line change
Expand Up @@ -1144,10 +1144,10 @@ function frmFrontFormJS() {
}

container.classList.add( 'frm_blank_field' );
const input = container.querySelector( 'input, select, textarea' );
const id = getErrorElementId( key, input );
const inputs = container.querySelectorAll( 'input, select, textarea' );
const id = getErrorElementId( key, inputs[ 0 ] );

let describedBy = input ? input.getAttribute( 'aria-describedby' ) : null;
let describedBy;

if ( typeof frmThemeOverride_frmPlaceError === 'function' ) { // eslint-disable-line camelcase
frmThemeOverride_frmPlaceError( key, jsErrors );
Expand All @@ -1160,8 +1160,8 @@ function frmFrontFormJS() {
errorHtml = `<div class="frm_error" ${ roleString } id="${ id }">${ jsErrors[ key ] }</div>`;
}
container.insertAdjacentHTML( 'beforeend', errorHtml );

if ( input ) {
inputs.forEach( input => {
describedBy = input ? input.getAttribute( 'aria-describedby' ) : null;
if ( ! describedBy ) {
describedBy = id;
} else if ( ! describedBy.includes( id ) && ! describedBy.includes( 'frm_error_field_' ) ) {
Expand All @@ -1173,10 +1173,10 @@ function frmFrontFormJS() {
}
}
input.setAttribute( 'aria-describedby', describedBy );
}
} );
}

if ( input ) {
inputs.forEach( input => {
if ( [ 'radio', 'checkbox' ].includes( input.type ) ) {
const group = input.closest( '[role="radiogroup"], [role="group"]' );
if ( group ) {
Expand All @@ -1185,7 +1185,7 @@ function frmFrontFormJS() {
} else {
input.setAttribute( 'aria-invalid', 'true' );
}
}
} );

jQuery( document ).trigger( 'frmAddFieldError', [ jQuery( container ), key, jsErrors ] );
}
Expand Down Expand Up @@ -1219,9 +1219,7 @@ function frmFrontFormJS() {
}

const errorMessage = container.querySelector( '.frm_error' );
const errorId = errorMessage ? errorMessage.id : '';
const input = container.querySelector( 'input, select, textarea' );
let describedBy = input ? input.getAttribute( 'aria-describedby' ) : null;

container.classList.remove( 'frm_blank_field', 'has-error' );

Expand All @@ -1237,25 +1235,43 @@ function frmFrontFormJS() {
}

if ( errorMessage ) {
removeElementFromInputDescribedBy( errorMessage );
errorMessage.remove();
}
}

if ( input ) {
input.removeAttribute( 'aria-describedby' );
if ( describedBy ) {
describedBy = describedBy.replace( errorId, '' ).trim();
if ( describedBy ) {
input.setAttribute( 'aria-describedby', describedBy );
}
/**
* Updates the aria-describedby attribute, removing the target element ID.
*
* @since x.x
*
* @param {HTMLElement} el The target element that is removed from the aria-describedby data.
* @return {void}
*/
function removeElementFromInputDescribedBy( el ) {
document.querySelectorAll( `[aria-describedby*="${ el.id }"]` ).forEach( input => {
let ariaDescribedBy = input.getAttribute( 'aria-describedby' ).split( ' ' );
ariaDescribedBy = ariaDescribedBy.filter( value => {
const trimmedValue = value.trim();
return trimmedValue && trimmedValue !== el.id;
} );

if ( ariaDescribedBy.length ) {
input.setAttribute( 'aria-describedby', ariaDescribedBy.join( ' ' ) );
return;
}
}
input.removeAttribute( 'aria-describedby' );
} );
}
Comment on lines +1243 to +1265
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Fix ESLint spacing error blocking CI.

The updateInputElementsAriaDescribedBy helper function correctly handles removing error IDs from all inputs' aria-describedby attributes. However, there's a spacing violation on line 1275 preventing the build from passing.

🔎 Fix for ESLint space-in-parens violation
 	function updateInputElementsAriaDescribedBy( el ) {
 		document.querySelectorAll( `[aria-describedby*="${ el.id }"]` ).forEach( input => {
 			let ariaDescribedBy = input.getAttribute( 'aria-describedby' ).split( ' ' );
 			ariaDescribedBy = ariaDescribedBy.filter( value => {
 				const trimmedValue = value.trim();
 				return trimmedValue && trimmedValue !== el.id;
-			});
+			} );
 
 			if ( ariaDescribedBy.length ) {
 				input.setAttribute( 'aria-describedby', ariaDescribedBy.join( ' ' ) );
 				return;
 			}
 			input.removeAttribute( 'aria-describedby' );
 		} );
 	}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
/**
* Updates the aria-describedby attribute of input elements to remove the error element ID.
*
* @since x.x
*
* @param {HTMLElement} el The error element.
* @return {void}
*/
function updateInputElementsAriaDescribedBy( el ) {
document.querySelectorAll( `[aria-describedby*="${ el.id }"]` ).forEach( input => {
let ariaDescribedBy = input.getAttribute( 'aria-describedby' ).split( ' ' );
ariaDescribedBy = ariaDescribedBy.filter( value => {
const trimmedValue = value.trim();
return trimmedValue && trimmedValue !== el.id;
});
if ( ariaDescribedBy.length ) {
input.setAttribute( 'aria-describedby', ariaDescribedBy.join( ' ' ) );
return;
}
input.removeAttribute( 'aria-describedby' );
} );
}
/**
* Updates the aria-describedby attribute of input elements to remove the error element ID.
*
* @since x.x
*
* @param {HTMLElement} el The error element.
* @return {void}
*/
function updateInputElementsAriaDescribedBy( el ) {
document.querySelectorAll( `[aria-describedby*="${ el.id }"]` ).forEach( input => {
let ariaDescribedBy = input.getAttribute( 'aria-describedby' ).split( ' ' );
ariaDescribedBy = ariaDescribedBy.filter( value => {
const trimmedValue = value.trim();
return trimmedValue && trimmedValue !== el.id;
} );
if ( ariaDescribedBy.length ) {
input.setAttribute( 'aria-describedby', ariaDescribedBy.join( ' ' ) );
return;
}
input.removeAttribute( 'aria-describedby' );
} );
}
🧰 Tools
🪛 GitHub Actions: Inspections

[error] 1275-1275: eslint: There must be a space before this paren (space-in-parens) at /home/runner/work/formidable-forms/formidable-forms/js/formidable.js:1275:5

🪛 GitHub Check: Run ESLint

[failure] 1275-1275:
There must be a space before this paren

🤖 Prompt for AI Agents
In @js/formidable.js around lines 1261 - 1283, ESLint space-in-parens violation:
remove extraneous spaces inside parentheses in
updateInputElementsAriaDescribedBy; e.g. change calls and callbacks like
document.querySelectorAll( `[aria-describedby*="${ el.id }"]` ),
input.getAttribute( 'aria-describedby' ).split( ' ' ), the .filter( value => {
... } ) callback, and input.setAttribute( 'aria-describedby',
ariaDescribedBy.join( ' ' ) ) to use no inner spaces (e.g.
`[aria-describedby*="${el.id}"]`, getAttribute('aria-describedby'), .split(' '),
.filter(value => { ... }), setAttribute('aria-describedby',
ariaDescribedBy.join(' '))). Ensure all parentheses in
updateInputElementsAriaDescribedBy follow the project's space-in-parens rule.


function removeAllErrors() {
document.querySelectorAll( '.form-field' ).forEach( field => {
field.classList.remove( 'frm_blank_field', 'has-error' );
} );
document.querySelectorAll( '.form-field .frm_error' ).forEach( error => error.remove() );
document.querySelectorAll( '.form-field .frm_error' ).forEach( el => {
removeElementFromInputDescribedBy( el );
el.remove();
} );
document.querySelectorAll( '.frm_error_style' ).forEach( error => error.remove() );
}

Expand Down
Loading