Giter VIP home page Giter VIP logo

ngx-line-truncation's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

ngx-line-truncation's Issues

MutationObserver is not defined in SSR

Library makes use of MutationObserver which is not available during Server Side Rendering of the angular app link. It would be nice if the library had a simpler fallback method if the MutationObserver doesn't exist.

[line-truncation] issue

[line-truncation] work's only once. Not accept furhter values updates. So when i change my value from 2 to 100 it continues to show only 2 rows.

Line sometimes stays hidden

https://github.com/DiZhou92/ngx-line-truncation/blob/6423a7b9ac9e70b87160427ce35905cc0a845937/projects/line-truncation-lib/src/lib/line-truncation.directive.ts#L135

Hi there, thanks for the cool library. However, I find that sometimes the element style is still hidden after rendering.

It happens randomly and I don't have a small test case for you but I though it is worth raising it here in case you can see anything obvious.

Could it be possible that clientHeight is <=0 ?

hasTruncated event is not emitted when it false

                if (contentHeight > targetHeight) {
                    truncate(element, this.lines, this.options.ellipsis, this.handler.bind(this));
                }
                else {
                    this.renderer.removeStyle(this.element, 'visibility');
                }

When I change line-truncation dynamically, it will not call truncate with callback this.handler, and thus no emit event.

Incorrect peer dependencies

Hi,

Could you please fix the peer dependencies? You are currently 'forcing' [email protected] dependency for anyone who uses your lib. You get a message such as:

npm WARN [email protected] requires a peer of @angular/common@~8.0.1 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/core@~8.0.1 but none is installed. You must install peer dependencies yourself.

You should configure peerDependencies to contain entire version 8 or I wouldn't be as worried as specifying future proof versions (e.g. > 8).

Produced values of output of `hasTruncated` is confusing

In case of using input watchChanges and too long text on each update hasTruncated - will produce two values.

  • First value emited after acutal value change.
  • The second will be emitted after line-truncation finish work and provide truncated value to DOM.
    So hasTruncated will emit isTruncated = false however actually text has been truncated.

Environment: See example

  • Editor that allow to write a long notes.
  • Note preview should display a few first lines.
  • Allow view all note's text by clicking on show more/ show less.

Step to reproduce:

  • Change text into textarea (Text should have enought symbols to apply truncation)
  • Press Save / sync changes button

image

Expected behavior:

  • hasTruncated - should emit one value true

Actual Behaviour:

  • hasTruncated - emitted true
  • hasTruncated - emitted false

Update to Angular 8

Thanks for the lib! Works fine in my Angular 8, but would be good to up the peer deps.

Just a question - not sure if its intended or not, but line truncating does not work properly when used in combination with fxFlex and changing resolution dynamically. Works ok for hard reload with F5 which is why this is not gonna be an issue in most situation, but still - elements can resize dynamically in some circumstances.

When disabled, falls with an error on resize

Hello and thank you for this cool library!

I've faced an issue when setting the disabled directive to true, and after that, resizing a window. Here are the screenshots:

image

The problem is, that in the putbackElement, when disabled, this.elementClone is null, so, we've got an exception.

image

Any ideas on how to fix it?

Thanks a lot!

Unable to resolve dependency tree with Angular 11

Hi all,

this project does not work with Angular 11 or higher due to the following error:

Found: @angular/[email protected]
npm ERR! node_modules/@angular/common
npm ERR!   @angular/common@"~11.2.6" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/common@"^10.0.1" from [email protected]
npm ERR! node_modules/ngx-line-truncation
npm ERR!   ngx-line-truncation@"^1.6.9" from the root project

I think the dependencies/peer dependencies must be updated or be more vague, e.g. @angular/common: "^10.0.0 || ^11.0.0". This is probably similar to #22 .

Thank you!

Input option to disable truncate

My goal is add "see more" button, after pressing it text must expands.
But I cant set lineCount to 999+, because of #10

Can we add input property disabled which will disable truncation logic?

<p [line-truncation]="lineCount" [disabled]="!isExpanded"></p>

Support for Virtual repeat

I have tested ngx-line-truncation and realize that it works on first init. but when i scroll out of a virtual repeat range, and scroll then back, the text is not cutted any more.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.