-
Notifications
You must be signed in to change notification settings - Fork 9
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
Feature Request | allowing new function props "onBeforeHeightMatched" and "onAfterHeightMatched" to trigger before/after height matched #11
Comments
Hi @tandrasi, I want to clarify your suggestion. Are you proposing to add If you’re suggesting adding simple events directly to the library, I’ve already implemented a custom event starting from version 2.0.0. You can find more details about it in the README. Let me know if I misunderstood or if you have further ideas! |
Thanks for the response. I agree that additional dependencies are not desirable. I have quickly glanced over the event emitted via the readme and I think it can be iterated upon to include the functionality I'm suggesting! Fire an event when height matching has started, and then another one when all calculations have completed AND animation has completed. This functionality was imperative for me to implement for a project that uses extremely complex and heavy calculations to render svg lines between elements on a map-type canvas. I needed to ensure all heights were matched and animations done before triggering recalculations of element positionings and svg drawings otherwise coordinates would be wrong. |
So just to confirm, do I understand correctly that the functionality you needed can be achieve using the custom events already available in the library? If so, can I close the topic? |
No I don't have this implemented with the "event" emitter as I don't think it can currently handle the complexity I'm after. However, I do have my own branch on which I have already implemented the callback functions as mentioned in this original post. So it's more of a suggestion. But the event stuff seems promising, just maybe needs more fleshing out. My current version debounces the requests and ensures to fire the callback after all heights are matched and animation times accounted for. |
I have the code already done and ported from 1.3.0 to 2.0.2, but please see my previous issue #10 .
I am happy to do a pull request. The issue I am using a dependency of "use-debounce".
What are your thoughts? I have this working perfectly.
/** Function to call when height matching is triggered, but before heights are matched */
onBeforeHeightMatched?: () => void;
/** Function to call after heights are matched */
onAfterHeightMatched?: () => void;
The text was updated successfully, but these errors were encountered: