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

SplitDateTimeField doesn't show errors #1065

Open
simplylizz opened this issue Sep 14, 2020 · 3 comments
Open

SplitDateTimeField doesn't show errors #1065

simplylizz opened this issue Sep 14, 2020 · 3 comments

Comments

@simplylizz
Copy link

simplylizz commented Sep 14, 2020

  • Package version: 1.9.2
  • Django version: 3.1.1
  • Python version: 3
  • Template pack: bootstrap4

Description:

SplitDateTimeField doesn't show errors. E.g. when only date is filled and time input is empty.

The issue is in CSS, block with error has display: none property while other fields with error don't because they have an additional class .is-invalid. See an attached screenshot.

Screenshot 2020-09-15 at 00 34 38

@smithdc1
Copy link
Member

Yes, this is related to existing issue with multifields with this template pack.

There is a tentative patch for this but I'm fairly sure that is the wrong way to fix it. #976

Any other ideas welcomed.

@simplylizz
Copy link
Author

simplylizz commented Sep 30, 2020

simplylizz@3c84035 - I'm going to stick with this workaround, for my case (building a prototype) it's enough. Yes, it will highlight all MultiWidget fields in case of error, though I think it's much better than a completely hidden error.

Also I don't know if it will break any other use cases, I'm not a frontend guy.

@edu2004eu
Copy link

For anyone looking for a quick, unintrusive workaround, you can simply add display: block to the error container.

#error_0_id_<field_name>, #error_1_id_<field_name> {
    display: block;
}

The container is only rendered if there's an error, so it wouldn't override anything unexpected.

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

No branches or pull requests

3 participants