Skip to content

Commit

Permalink
Fix box-sizing
Browse files Browse the repository at this point in the history
Add demo link
  • Loading branch information
Tudor Gergely committed Mar 17, 2017
1 parent 535a548 commit ef9f34d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

***angular2-stretchy*** is an Angular2 directive that automatically adjusts input width to fit content.

## Demo:

https://tudorgergely.github.io/angular2-stretchy/

## Installation:

```bash
Expand Down Expand Up @@ -42,4 +46,4 @@ Set normal styling on input such as min-width

## Licence

This project is licensed under the MIT license. See the [LICENSE](LICENSE) file for more info.
This project is licensed under the MIT license. See the [LICENSE](LICENSE) file for more info.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular2-stretchy",
"version": "1.0.0",
"version": "1.0.1",
"description": "Angular 2 directive to make input have a dynamic width",
"main": "index.ts",
"author": "Tudor Gergely <[email protected]>",
Expand Down
5 changes: 5 additions & 0 deletions stretchy.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ export class StretchyDirective implements OnInit {
@HostBinding('style.width.px')
private inputWidth: number = 0;

@HostBinding('style.box-sizing')
private get boxSizing() {
return 'content-box';
}

private sizeDiv;

constructor(private renderer: Renderer,
Expand Down

0 comments on commit ef9f34d

Please sign in to comment.