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 ); + } }