-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
feat(useElementOverflow): new function #4094
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
base: main
Are you sure you want to change the base?
Conversation
onUpdated?: ResizeObserverCallback | MutationCallback | ||
} | ||
|
||
export function useElementOverflow(target: MaybeComputedElementRef, option: UseElementOverflowOptions = {}) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add some description for it ? and options
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zyyv Thanks,I added some for it.
Hey @inside5545 thanks for your PR, In order to eventually merge this, we need to cover this with tests so that it is easier to maintain. Could you imagine writing the tests for this, or do you need any support? Please let me know :) |
@OrbisK Thank you for your reply, of course, but I have a lot of work at the end of the year, so I may do it slowly. I would appreciate it if someone could help me finish it. Or if you're sure it's going to be merged, I'll try harder to find the time to add the tests |
this should also fix #3686 |
@OrbisK I'll try to find the time to do it, but I still want someone to help me finish it. TAT~ |
How can I help? What is still missing? |
I will check the CI. I think if this will be merged. #3686 is also completed :) no actions to do there |
THANK YOU so so so much ~! |
@OrbisK I've updated the code, please merge the PR if it is convenient |
Is there a plan for when this will be merged? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me 👍
Before submitting the PR, please make sure you do the following
fixes #123
).Description
fixes #3686
this function helps to react a dom's overflow state, the scenario is that sometimes we need to determine if a container dom become overlength and then need to add some style. for example, maybe the text is too long, we need to add a tooltip bubble to it.
Additional context
I already see the [Warning: Slowing down new functions],and I often create common components and codes, I think useElementOverflow is really necessary,so I take some time to create the hook,directive and components.