DataTables Editor: Bootstrap 4 changed .has-error to .is-invalid but my inputs do not have these.

DataTables Editor: Bootstrap 4 changed .has-error to .is-invalid but my inputs do not have these.

washuit-iammwashuit-iamm Posts: 133Questions: 55Answers: 2
edited May 2018 in Free community support

I noticed that DataTable's Editor applied a class called has-error. Are there any plans to change this to is-invalid on the input? Or is the has-error class name a coincidence with BootStrap's 3's classes?

https://getbootstrap.com/docs/4.1/migration/#forms-1 the second to last bullet.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,455Questions: 1Answers: 10,465 Site admin
    Answer ✓

    You are right - its a fallover from the Bootstrap 3 integration.

    The reason I've not gone full in on the :invalid selector (other than compatibility for older browsers, that BS4 doesn't support any more, but Editor does) is that I wasn't aware of a method to set it programmatically (having just looked into it again, it appears that there is a setCustomValidity() DOM method which could be used).

    At the moment the :invalid state is only triggered based on the input type (e.g. checking for an e-mail address) which isn't enough for most inputs in Editor. This setCustomValidity method might be the cure for that.

    That said - it looks like I should be using is-invalid rather than has-error in the Bootstrap 4 integration. I've made that change locally and it will be in 1.7.4.

    Regards,
    Allan

This discussion has been closed.