Skip to content

Changes to effect textarea with the validation directive. #2

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
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/js/ionic-validation-directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,13 @@
else
$animate.removeClass(value, scope.errorClass);
});
angular.forEach(element.find('textarea'), function (value, key) {
//var el = angular.element(value);
if (scope.showError())
$animate.addClass(value, (scope.errorClass));
else
$animate.removeClass(value, scope.errorClass);
});
}

calcIconWidth(scope.showError());
Expand Down
8 changes: 4 additions & 4 deletions src/scss/ionic-validation-directive.scss
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ $error-message-transition: opacity 0.2s ease-in-out, max-height 0.2s ease-in-out
}

// Makes sure that all inputs fill the width of the container
.validation-item-container:not(.ionic-style) input {
.validation-item-container:not(.ionic-style) input, .validation-item-container:not(.ionic-style) textarea {
width: 100%;
}

Expand Down Expand Up @@ -122,17 +122,17 @@ $error-message-transition: opacity 0.2s ease-in-out, max-height 0.2s ease-in-out
}

// Enables animations
.validation-item-container.animate:not(.ionic-style) input {
.validation-item-container.animate:not(.ionic-style) input, .validation-item-container.animate:not(.ionic-style) textarea {
@include transition($error-style-on-transition);
}

// This is required for use of box-shadows on iOS
.validation-item-container:not(.ionic-style) input {
.validation-item-container:not(.ionic-style) input, .validation-item-container:not(.ionic-style) textarea {
-webkit-appearance: none;
}

// The default error class for regular inputs
.validation-item-container.has-error:not(.ionic-style) input.default-error-class {
.validation-item-container.has-error:not(.ionic-style) input.default-error-class, .validation-item-container.has-error:not(.ionic-style) textarea.default-error-class {
box-shadow: inset 13px 0 0 -10px $error-color;
}

Expand Down