Skip to content

Commit

Permalink
chore(demo): adding useImportant to demo page
Browse files Browse the repository at this point in the history
  • Loading branch information
chrum committed Feb 17, 2019
1 parent 3df71c7 commit 477ecb9
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ngx-autosize-app",
"version": "1.4.1",
"version": "1.5.0",
"homepage": "https://chrum.it/pages/ngx-autosize",
"description": "Directive that automatically adjusts textarea height to fit content",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion projects/autosize/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ngx-autosize",
"version": "1.4.1",
"version": "1.5.0",
"homepage": "https://chrum.it/pages/ngx-autosize",
"description": "Directive that automatically adjusts textarea height to fit content",
"repository": {
Expand Down
16 changes: 16 additions & 0 deletions src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,22 @@ <h3>Only growing <input type="checkbox" [(ngModel)]="onlyGrow"/></h3>

<hr/>

<div>
<h3>
<h3>Use '!important' <input type="checkbox" [(ngModel)]="useImportant"/></h3>
</h3>
<form [formGroup]="reactiveForm">
<textarea type="text" class="forceImportant"
[useImportant]="useImportant"
autosize>This one shouldnt work correctly without 'useImportant' Input set
as there is a
harmful
and malicious '!important' somewhere in the styles</textarea>
</form>
</div>

<hr/>

<div>
<h3>[ formControl ]
<button (click)="updateReactiveText()">Change</button>
Expand Down
4 changes: 4 additions & 0 deletions src/app/app.component.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
textarea {
min-width: 450px;

&.forceImportant {
height: auto !important
}
}
1 change: 1 addition & 0 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export class AppComponent {
public minRows = 3;
public maxRows = 4;
public onlyGrow = true;
public useImportant = true;

reactiveText = new FormControl(longText);
reactiveForm = new FormGroup({
Expand Down

0 comments on commit 477ecb9

Please sign in to comment.