Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance ellipsis component #75

Open
chenquincy opened this issue Jun 11, 2021 · 3 comments
Open

Enhance ellipsis component #75

chenquincy opened this issue Jun 11, 2021 · 3 comments
Labels
feature request New feature or request

Comments

@chenquincy
Copy link

What problem does the feature solve?

Refer to react-ellipsis.

I think these features are necessary for an Ellipsis component:

  • control whether clamp
  • custom ellipsis node
  • end character filter

I can make a pr with pleasure if in need.

@07akioni
Copy link
Collaborator

07akioni commented Jun 11, 2021

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.

@chenquincy
Copy link
Author

chenquincy commented Jun 11, 2021

@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?

@07akioni
Copy link
Collaborator

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants