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

Move radio checkbox select help text out of div #123

Merged
merged 1 commit into from
Sep 28, 2022

Conversation

pickfire
Copy link
Contributor

@pickfire pickfire commented Sep 27, 2022

Currently, the help text is included in the div, if a scroll class is added to field_class, it will result in the errors and help text being shown as part of the scroll and have to scroll to the bottom of the inner container to see it. This likely won't be surprising as the other fields, the help text are beside the input and not within the input container.

In our case, we have overridden the field_class with Field('industry', css_class="industry-scroll"), and added the css

.industry-scroll {
  overflow-y: scroll !important;
  max-height: 300px !important;
}

Before: help text is scrolling with content (showing at the end of the inner container)

image(1)

Before: help text is scrolling with content (helptext is not visible at first)

image(2)

After

image

@smithdc1
Copy link
Member

Thanks for the patch, looks good.

Could we add a test for this? Here's a test we have for grouped checkboxes and radios. Maybe just adding some help_text here would be enough.

def test_grouped_checkboxes_radios(self):

@pickfire
Copy link
Contributor Author

Added tests.

Currently, the help text is included in the div, if a scroll class is added to `field_class`,
it will result in the errors and help text being shown as part of the scroll and have to
scroll to the bottom of the inner container to see it. This likely won't be surprising as
the other fields, the help text are beside the input and not within the input container.
@smithdc1 smithdc1 merged commit 521514e into django-crispy-forms:main Sep 28, 2022
@smithdc1 smithdc1 added this to the Version 0.7 milestone Sep 28, 2022
@pickfire pickfire deleted the patch-1 branch September 29, 2022 01:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants