Skip to content

Commit

Permalink
chore(): updating demo and version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
chrum committed May 24, 2020
1 parent b05fb77 commit ff59433
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 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.8.0-next",
"version": "1.8.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.8.0-next",
"version": "1.8.0",
"homepage": "https://chrum.it/pages/ngx-autosize",
"description": "Directive that automatically adjusts textarea height to fit content",
"repository": {
Expand Down
6 changes: 4 additions & 2 deletions src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@
<h3>Regular textarea
<button (click)="changeNgModel()">Change</button>
</h3>
<textarea [(ngModel)]="longText" autosize></textarea>
<textarea [(ngModel)]="longText"
(resized)="onResized($event)"
autosize></textarea>
</div>

<hr/>

<div>
<h3>Min rows <input [(ngModel)]="minRows"/></h3>
<textarea autosize [minRows]="minRows">Less than 3 rows of text but it should keep size </textarea>
<textarea autosize rows="1" [minRows]="minRows">1 row of text but it should keep size </textarea>
</div>

<hr/>
Expand Down
6 changes: 5 additions & 1 deletion src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Text area should come back to its original form :)
export class AppComponent implements OnInit {
public longText = longText;
public resetableContent = resetExplanation;
public minRows = 3;
public minRows = 1;
public maxRows = 4;
public onlyGrow = true;
public useImportant = true;
Expand Down Expand Up @@ -57,4 +57,8 @@ export class AppComponent implements OnInit {
resetArbitraryExample() {
this.resetableContent = resetExplanation;
}

onResized(newHeight) {
console.log(newHeight);
}
}

0 comments on commit ff59433

Please sign in to comment.