Giter VIP home page Giter VIP logo

Comments (3)

07akioni avatar 07akioni commented on May 22, 2024

As far as I know there would be some edge cases for js dom slicing and measuring based ellipsis. For example non-text inline element is hard to deal with. (and i think it may break vue's patching phase (when user changes slot content).

I'm not planning to do it.

However if you have knowledge about how to solve those problems. PR is welcomed.

from naive-ui.

chenquincy avatar chenquincy commented on May 22, 2024

@07akioni I agree with you, how to judge the row count(1 or multiple of text's line-height) of a non-text inline element(higher than text) is divergent. I compute total height by text's line-height and line-clamp in react-ellipsis to avoid the edge cases, but it can't be suit to any case actually. Never mind js slicing here, but maybe add a prop to control whether clamp could be better?

from naive-ui.

07akioni avatar 07akioni commented on May 22, 2024

@07akioni I agree with you, how to judge the row count(1 or multiple of text's line-height) of a non-text inline element(higher than text) is divergent. I compute row count by text's line-height and line-clamp in react-ellipsis to avoid the edge cases, but it can't be suit to any case actually. Never mind js slicing here, but maybe add a prop to control whether clamp could be better?

I think it's okay. If you want to use custom ellipsis, you need to ensure only text is passed in.

from naive-ui.

Related Issues (20)

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.