Is there any danger of not working with Bootstrap v4 beta testing anymore?

According to Bootstrap Migration Guide :

Renamed .has-error to .has-danger.

However, this does not work. The border and text were not painted.

For instance:

<div class="form-group has-danger">
    <label class="form-control-label" for="inputDanger1">Input with danger</label>
    <input type="text" class="form-control form-control-danger" id="inputDanger1">
    <div class="form-control-feedback">Sorry, that username taken. Try another?</div>
    <small class="form-text text-muted">Example help text that remains unchanged.</small>
</div>

Demo:

https://jsfiddle.net/uLa0spfm/

+4
source share
3 answers

While Bootstrap 4 is still in beta, most migration documentation does not sync with the actual versions. Validation has changed in beta , but has-dangerno longer exists.

.: Bootstrap 4

+5

. @ZimSystem .

.has-danger Alpha, Bootstrap v4 Beta. is-invalid , class="invalid-feedback" .

:

<div class="form-group has-danger">
    <label class="form-control-label">Username</label>
    <input type="text" class="form-control is-invalid">
    <div class="invalid-feedback">Sorry, that username taken. Try another?</div>
</div>
+6

Source: https://habr.com/ru/post/1685538/


All Articles