Skip to content

Validation CSS classes are not assigned to custom controls with Bootstrap 5.x #143

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

Open
11 of 17 tasks
tmrepo opened this issue Aug 5, 2024 · 0 comments
Open
11 of 17 tasks

Comments

@tmrepo
Copy link

tmrepo commented Aug 5, 2024

Prerequisites

  • I have searched for similar issues in both open and closed tickets and cannot find a duplicate.
  • The issue still exists against the latest master branch of yii2-widget-activeform.
  • This is not a usage question. I confirm having gone through and read the documentation for ActiveForm and ActiveField.
  • This is not a general programming / coding question. (Those should be directed to the webtips Q & A forum).
  • I have attempted to find the simplest possible steps to reproduce the issue.
  • I have included a failing test as a pull request (Optional).

Steps to reproduce the issue

  1. Go to https://demos.krajee.com/widget-details/active-field#custom-select
  2. Do not select any option in the dropdowns.
  3. Press Submit

Expected behavior and actual behavior

When I follow those steps, I see the validation message ("Weekdays cannot be blank") but the select element borders do not change colour are there is no background image. Element does not have is-invalid class.

I was expecting the select element borders to turn red and a background image appear to indicate error. The element should have is-invalid class.

Bootstrap 5 version for custom controls uses form-select for select and form-check-input for other custom controls. These are not used in activeform.js:

var controls = ['.form-control', '.custom-control-input', '.custom-select', '.custom-range', '.custom-file-input'],

Environment

Browsers

  • Google Chrome
  • Mozilla Firefox
  • Internet Explorer
  • Safari

Operating System

  • Windows
  • Mac OS X
  • Linux
  • Mobile

Libraries

  • jQuery version: 3.7.1
  • yii2-widget-activeform version: v1.6.4

Isolating the problem

  • This bug happens on the demos page
  • The bug happens consistently across all tested browsers
  • This bug happens when using yii2-widget-activeform without other plugins.
tmrepo added a commit to tmrepo/yii2-widget-activeform that referenced this issue Aug 5, 2024
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

1 participant