-
Notifications
You must be signed in to change notification settings - Fork 146
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
Rewrite useOverflowItems
utility as vanilla JS
#6883
Rewrite useOverflowItems
utility as vanilla JS
#6883
Comments
useOverflowItems
utility as vanillauseOverflowItems
utility as vanilla JS
some of my opinions and initial explorations it is better to have the utility responsible only for calculations, by taking widths of the items mapped to their ids in dom, size of the container, and overflow at end or start since these are purely a bunch of calculations. we can use this on vertically stacked elements as well, in that case we send height of the elements and total height of the container.
this approach requires us to provide the sizes of the items and container size. and the utility is responsible only for making those calculations. in a react application we can get widths by passing a ref and getting offsetWidth i feel getting the widths of the elements is framework dependent task and should not be in the scope of this utility. a different strategy from thoughts these are only my initial thoughts and a lot of things need to taken into consideration. hope these are useful in implementing this utility. |
Currently,
useOverflowItems
is written as a React hook, but to support the many acquisitions teams looking to use the TagSet, we’d want to rewrite this as a vanilla utility provided through@carbon/utilities
.Acceptance criteria
useOverflowItems
as framework agnostic@carbon/utilities
packageThe text was updated successfully, but these errors were encountered: