softconstruct / gene-ui-components

The Gene UI components library designed for BI tools
https://geneui-storybook.softconstruct.com
MIT License
14 stars 0 forks source link

[Feat]: create useEllipsisMultilineDetection hook #72

Closed GaroGabrielyan closed 8 months ago

GaroGabrielyan commented 9 months ago

Component

useEllipsisMultilineDetection

Is your feature request related to a problem? Please describe.

Currently, we have a hook called useEllipsisDetection that detects single-line text truncation. However, there is a need for a similar hook that can detect multiline text truncation.

Describe the solution you'd like

The useEllipsisMultilineDetection hook will provide functionality to detect when multiline text within an element is truncated due to ellipsis. It will be useful for scenarios where we need to dynamically adjust the layout or behavior based on whether multiline text is truncated. The hook will get the ref of element and will return boolean value is truncated or not.

Describe alternatives you've considered

No response

Are you able to assist to bring the feature to reality?

no

Additional context

No response

GaroGabrielyan commented 9 months ago

After thorough investigation, we have concluded that useEllipsisDetection hook can be scaled to detect text truncation, both in single-line and multiline scenarios.