telerik / kendo-theme-bootstrap

Kendo UI theme, based on Bootstrap v4
Other
25 stars 14 forks source link

Do not add "invalid" styling to the input when the form field is not touched #329

Closed dtopalov closed 6 years ago

dtopalov commented 7 years ago

Context: Angular app

When a field is required, but still not touched it gets styled as invalid (for example, a new row is added to a Grid):

http://plnkr.co/edit/NCWI8nEQX5EFzRFjRKTK?p=preview

... while when the kendo-theme-default is used, the field gets the "invalid" styling only after it is touched:

http://plnkr.co/edit/nONnTb98KUaAvrrqDqb5?p=preview

Expected behavior: consistent approach for invalid, but untouched form fields across the themes.

kendo-theme-default:

.k-textbox,
.k-input.k-textbox,
.k-textarea {
    @include appearance( "input" );
    background-clip: padding-box;
...
    &.k-state-invalid,
    &.ng-invalid.ng-touched,
    &.ng-invalid.ng-dirty {
        color: $error;
        border-color: $invalid-border;
    }

kendo-theme-bootstrap:

.k-input,
.k-textbox,
.k-input.k-textbox {
    @include appearance( "input" );
    transition: $transition;
 ...
    // Invalid
    &:invalid,
    &.k-state-invalid,
    &.ng-invalid {
        color: $error;
        border-color: $invalid-border;
    }
bebleu commented 6 years ago

Hello, Is there a workaround for this problem at this moment ?

Thanks

felixblack commented 6 years ago

Hi. Have the save problem when i put required attr. <input type="text"required class="k-textbox" /> But i dont want the style invalid on load page.

Is there configuration for not initialization styled invalid ?

joneff commented 6 years ago

Fixed by https://github.com/telerik/kendo-themes/pull/343