This repository has been archived by the owner on Mar 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 24
Ionic Elastic Textarea
Miroslav Smukov edited this page Jun 30, 2016
·
8 revisions
import {Component, ViewChild} from '@angular/core';
@Component({
selector: 'elastic-textarea',
inputs: ['placeholder', 'lineHeight', 'content'],
template:
`
<ion-textarea #ionTxtArea
placeholder='{{placeholder}}'
[(ngModel)]="content"
(ngModelChange)='onChange($event)'></ion-textarea>
`,
queries: {
ionTxtArea: new ViewChild('ionTxtArea')
}
})
export class ElasticTextarea {
constructor() {
this.content = "";
this.lineHeight = "22px";
}
ngAfterViewInit(){
this.txtArea = this.ionTxtArea._elementRef.nativeElement.children[0];
this.txtArea.style.height = this.lineHeight + "px";
}
onChange(newValue){
this.txtArea.style.height = this.lineHeight + "px";
this.txtArea.style.height = this.txtArea.scrollHeight + "px";
}
clearInput(){
this.content = "";
this.txtArea.style.height = this.lineHeight + "px";
}
}
- Android
- Getting Started
- Project Structure
- Gradle
- Menu
- Theming
- Login Screen
- Menu & Navigation
- Importing Library From GitHub
- Creating Reusable Layouts
- Adding New Icons
- Profile Screen
- Chat Screen
- Contacts Screen
- Pending Invites Screen
- Settings Screen
- Add Library Dependency
- Discover Users Screen
- Splash Screen
- Auth0
- Authentication Logic
- Profile Screen Logic
- Send Feedback
- Authenticated to Firebase via Auth0
- Saving User Info to Firebase
- Storing User Connection Info to Firebase
- Calculating Distance Between Users
- Chat Logic
- Handling Device Rotation
- Android Other
- Ionic
- Getting Started
- Project Structure
- Menu
- Theming
- Login Screen
- Adding Images
- Creating Reusable Layouts
- Adding New Icons
- Profile Screen
- Contact Screen
- Elastic Textarea
- Chat Bubble
- Chat Screen
- Contacts Screen
- Pending Invites Screen
- Settings Screen
- Discover Users Screen
- Splash Screen
- Animations
- Auth0
- Storing User Data
- Profile Screen Logic
- Send Feedback
- Update to Ionic RC0
- Reimplemented Auth0 with Ionic RC0
- Authenticated to Firebase via Auth0
- Saving User Info to Firebase
- Storing User Connection Info to Firebase
- Calculating Distance Between Users
- Chat Logic
- Handling Device Rotation
- Ionic Other
- Version Updating
- Cordova
- Other
- Messaging