From 2df5c5000cc0371045702936152ba97add7c22e3 Mon Sep 17 00:00:00 2001 From: "vivi-the-going-merry[bot]" <308115520+vivi-the-going-merry[bot]@users.noreply.github.com> Date: Mon, 26 Oct 2026 11:58:10 -0600 Subject: [PATCH] Fix Other input missing full-width class on single-select dropdowns Co-Authored-By: Claude Sonnet 5.5 --- classes/helpers/FrmFieldsHelper.php | 2 +- tests/phpunit/fields/test_FrmFieldsHelper.php | 27 +++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/classes/helpers/FrmFieldsHelper.php b/classes/helpers/FrmFieldsHelper.php index 98caf34e22..fcd7718b65 100644 --- a/classes/helpers/FrmFieldsHelper.php +++ b/classes/helpers/FrmFieldsHelper.php @@ -1846,7 +1846,7 @@ public static function include_other_input( $args ) { $classes[] = 'frm_pos_none'; } - if ( $args['field']['type'] === 'select' && ! empty( $args['field']['multiple'] ) ) { + if ( $args['field']['type'] === 'select' ) { $classes[] = 'frm_other_full'; } diff --git a/tests/phpunit/fields/test_FrmFieldsHelper.php b/tests/phpunit/fields/test_FrmFieldsHelper.php index 5abd9ea002..b11f29851c 100644 --- a/tests/phpunit/fields/test_FrmFieldsHelper.php +++ b/tests/phpunit/fields/test_FrmFieldsHelper.php @@ -376,4 +376,31 @@ public function test_get_error_msg_invalid_is_field_type_specific() { $error_message = FrmFieldsHelper::get_error_msg( $field, 'invalid' ); $this->assertSame( 'Please fix Comment', $error_message ); } + + /** + * @covers FrmFieldsHelper::include_other_input + */ + public function test_include_other_input_full_width_for_dropdowns() { + $args = array( + 'other_opt' => true, + 'field' => array( + 'id' => 1, + 'name' => 'Test', + 'type' => 'select', + 'multiple' => false, + ), + 'opt_key' => 'other_1', + 'html_id' => 'field_test', + 'name' => 'item_meta[other][1]', + 'value' => '', + 'checked' => '', + 'read_only' => false, + ); + + ob_start(); + FrmFieldsHelper::include_other_input( $args ); + $html = ob_get_clean(); + + $this->assertStringContainsString( 'frm_other_full', $html ); + } }