Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not wrap inline items for custom field value lists #781

Closed
wants to merge 1 commit into from

Conversation

cproensa
Copy link
Contributor

@cproensa cproensa commented May 27, 2016

Avoid wrapping of each individual item that is part of a custom
fields value list, displayed as inline inputs.

Fixes #0020964

@dregad
Copy link
Member

dregad commented May 29, 2016

Any particular reason why you removed the for attribute on the labels ?

Missing Fixes #20964 reference in commit message.

+1

@@ -321,10 +321,11 @@ function cfdef_input_checkbox( array $p_field_def, $p_custom_field_value ) {
for( $i = 0; $i < count( $t_values ); $i++ ) {
$t_input_id = 'custom_field_' . $p_field_def['id'] . '_value_' . $i;
$t_input_name = 'custom_field_' . $p_field_def['id'] . '[]';
echo '<input id="$t_input_id" ' . helper_get_tab_index() . ' type="checkbox" name="' . $t_input_name . '" value="' . string_attribute( $t_values[$i] ) . '"';
echo '<label class="nowrap">' ;
Copy link
Member

Choose a reason for hiding this comment

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

extra space before ;

@cproensa
Copy link
Contributor Author

cproensa commented May 29, 2016

Any particular reason why you removed the for attribute on the labels ?

Seems like having the input inside the label block, makes the label to apply the nowrap property to the whole content. (in the example of the checkbox list)
With the "for" syntax, the label and input are rendered as independent flowed blocks, and most of the times the checkbox is placed in a different line that the label text, if line wrap occurs.

(*) i've just noticed that in chrome there's a small chance that the checkbox is separated from the label, when no part of the label text fits in the current line. Firefox, however, works better in that situation, keeping the checkbox always attached to the label text...

Avoid wrapping of each individual item that is part of a custom
fields value list, displayed as inline inputs.

Fixes #20964
@cproensa
Copy link
Contributor Author

extra space before ;
Missing Fixes #20964 reference in commit message.

fixed
thanks.

@dregad dregad added the merged label May 31, 2016
@dregad
Copy link
Member

dregad commented May 31, 2016

Fixed in 1d3af0c

@dregad dregad closed this May 31, 2016
@cproensa cproensa deleted the 0020964_cf_nowrap branch November 6, 2016 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants