stevepapa / ng-autosize Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Hello,
i'm trying to use ng-autosize, when i put maxHeight at 300px and i write text more than maximum, I don't see a scroll. overflow is set to hidden even if max is exceed.
thank's
I see that the default height of the textarea is always equivalent to 2 rows. A lot of my content is single row. How can I get the height to match 1 row, unless I hit enter?
I don't think I can use minHeight
as it will effect, in case the font size is high.
after installing on ionic project i get this error.
i had imported Autosize in app.module.ts and added entry in declaration and entry point.
Error: ./node_modules/ng-autosize/index.ts
Module build failed: Error: ENOENT: no such file or directory, open '\node_modules\ng-autosize\index.js'
at Error (native)
@ ./src/app/app.module.ts 7:0-39
@ ./src/app/main.ts
at BuildError.Error (native)
at new BuildError (\node_modules@ionic\app-scripts\dist\util\errors.js:16:28)
at callback (\node_modules@ionic\app-scripts\dist\webpack.js:119:28)
at emitRecords.err (\node_modules\webpack\lib\Compiler.js:269:13)
at Compiler.emitRecords (\node_modules\webpack\lib\Compiler.js:375:38)
at emitAssets.err (\node_modules\webpack\lib\Compiler.js:262:10)
at applyPluginsAsyncSeries1.err (\node_modules\webpack\lib\Compiler.js:368:12)
at next (\node_modules\tapable\lib\Tapable.js:218:11)
at Compiler.compiler.plugin (\node_modules\webpack\lib\performance\SizeLimitsPlugin.js:99:4)
at Compiler.applyPluginsAsyncSeries1 (\node_modules\tapable\lib\Tapable.js:222:13)
If the textarea starts with content, autosize will not adjust to it initially. It also reverts back to its original starting size after saving, even if the content therein persists.
Thanks for a great plugin. Works perfectly locally.
I can even do ng build --prod locally and it works.
But when I push to Heroku and run ng build --prod there I get this error:
ERROR in Error encountered resolving symbol values statically. Could not resolve ng-autosize relative to /tmp/build_b603406cd4d5ef76bd2b93850c142424/src/app/pages/templates/templates.module.ts
You can see I have loaded the directive in a sub-module that is dynamically loaded on a particular route. If I load the directive in my app.module instead then the directive does not work (everything builds, even on heroku, but the directive never fires inside the component that is inside the templates.module).
I have a shared directives module - I also tried importing and exporting it there, which works. But when I deploy to Heroku I get the same resolving symbol error.
Angular 4.3.4
Angular-cli 1.3.0
Autosize doesn't work when the textarea width is changed dynamically and the text within it wraps into multiple lines. It seems to listen to only enter
keyboard. The same issue can be seen in the demo page as well. Try reducing the width of the textarea.
http://stevepapa.com/ng-autosize
I encounter a strange problem.
When I add extra lines, everything works fine, and the textarea can be vertical enlarged well.
But when I reduce a line, the textarea can't seem to be automatically shrinked.
Hope to get an answer.T.T
sorry. misplaced issue. not sure how to delete it entirely....
In this case, the textarea is disabled, because it is part of a fieldset that is disabled.
When using Angular 5, Typescript 2.6.x, and enabling the noUnusedLocals
compiler option in tsconfig.json
, it produces this error when attempting to build:
ERROR in
node_modules/ng-autosize/src/autosize.directive.ts(12,13): error TS6133: '_lastHeight' is declared but its value is never read.
node_modules/ng-autosize/src/autosize.directive.ts(34,14): error TS6133: 'textArea' is declared but its value is never read.
node_modules/ng-autosize/src/autosize.directive.ts(42,11): error TS6133: 'textArea' is declared but its value is never read.
node_modules/ng-autosize/src/autosize.directive.ts(53,52): error TS2345: Argument of type 'null' is not assignable to parameter of type 'string | undefined'.
This seems related to #12 - if that were fixed, this problem would likely just go away. However, those error make some good suggestions for code cleanup.
There are a few pull requests that are dying to be merged but no news from @stevepapa ...
I just upgraded to Angular 5.0.0 and when I compile I get the following error:
ERROR in ./node_modules/ng-autosize/index.ts
Module build failed: Error: /Users/ppennings/Develop/NIS-frontend/node_modules/ng-autosize/index.ts is not part of the compilation output. Please check the other error messages for details.
at AngularCompilerPlugin.getCompiledFile (/Users/ppennings/Develop/NIS-frontend/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:629:23)
at plugin.done.then (/Users/ppennings/Develop/NIS-frontend/node_modules/@ngtools/webpack/src/loader.js:467:39)
at
at process._tickCallback (internal/process/next_tick.js:188:7)
@ ./src/app/shared/shared.module.ts 47:0-39
@ ./src/app/upload-asset/upload-asset.module.ts
@ ./src/$$_lazy_route_resource lazy
@ ./node_modules/@angular/core/esm5/core.js
@ ./src/main.ts
@ multi webpack-dev-server/client?http://0.0.0.0:0 ./src/main.ts
It looks like [maxHeight]="100px"
is incorrect and should instead be [maxHeight]="100"
https://github.com/stevepapa/ng-autosize/blame/master/README.md#L50
Similarly for [minHeight]
https://github.com/stevepapa/ng-autosize/blame/master/README.md#L44
I added the autosize
attribute and everything works perfectly when I am editing the content of my form.
However, I have an issue when I load my form. The textarea is not resized based on the content.
To briefly explain :
FormGroup
using setValue
FormGroup
using reactive form feature FormControl
However on first load, the textarea is not resized as if it has not seen the value passed by the FormControl
. Note that if I start to type inside, it resizes correctly.
Note : on step 2, the data is loaded asynchronously
When adding new lines/more text the directive works perfectly, but when text is removed it should shrink accordingly.
Looking for developers that want to support in maintaining this project.
If you find this package useful and would like to help maintain it or collaborate, post a comment on this issue.
Unsure if this is due to the any other settings ('box-sizing: border-box' ?) but when the <textarea autosize>
has a style border: 0
the text area does not become smaller when text is removed.
It still correctly increases the size of the box when text is added.
I solved my problem by setting the border to 1 px of the same color as background, but wanted to bring this bug to your attention.
I have a toggle that changes the width of the container that holds <textarea autosize>
and the font size inside. When using angular2-autosize
, the height of the textarea would be updated by the directive (when the toggle would be pressed), but after the update to ng-autosize
the textarea height no longer changes until I start typing.
I suspect this is a side-effect of the optimizations you've included in this newer version (fewer events detected?).
Please let me know if I could describe the issue better, and whether this is intended behavior or may be fixed in a future release.
Could you please just publish the .js and .d.ts file to npm?
Otherwise we always get this error:
Module build failed: Error: d:\Development\git\futura-connectivity\src\Opten.FuturaConnectivity.Web.UI.Client\node_modules\ng-autosize\index.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
The missing file seems to be part of a third party library. TS files in published libraries are often a sign of a badly packaged library. Please open an issue in the library repository to alert its author and ask them to package the library using the Angular Package Format (https://goo.gl/jB3GVv).
You can just add a .npmignore
whit this content:
*.ts
!*.d.ts
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.