Closed pxao02 closed 3 years ago
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Prerequisites
master
branch of yii2-password.Steps to reproduce the issue
The docs state that using
kartik\form\ActiveForm
is optional. So I used the defaultyii\bootstrap4\ActiveForm
in combination with the password input widget. However, there's an issue with the red error text.yii\bootstrap4\ActiveForm
andkartik\password\PasswordInput
while setting Bootstrap version to 4Expected behavior and actual behavior
Expected: red border and red error text below the input box as per Bootstrap 4.
Actual: only red border, the red error text is not visible.
Cause of problem
The original password input box is replaced with the widget, where the input is deeper in the DOM. The original Bootstrap CSS requires the error text div to be a sibling from the input in order to trigger a
display:block
. Since they are not siblings, the error text remainsdisplay:none
and will not show.Solution
The required CSS to get the error text to
display:block
is present in the CSS that comes included with Kartik's ActiveForm. The solution is therefore to usekartik\form\ActiveForm
instead ofyii\bootstrap4\ActiveForm
.Suggested change
Update the docs to reflect that optimal function in Bootstrap 4 is only when the password widget is combined with Kartik's ActiveForm.
With Bootstrap 3 it works fine.
Environment
N/A