-
-
Notifications
You must be signed in to change notification settings - Fork 120
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
[RFC] Use/wrap upstream signature_pad #17
Comments
I think that's a great idea. I'd need to look into it myself but this would certainly make it easier to maintain the repo. I assumed it was using |
From what I could tell (I didn't do any wholesale diffs as line number and other changes make that difficult), the code looks to have been mostly copied from |
I think it sounds good too. There isn't really all that much gained by maintaining a copy of everything. It'll require some logic for handling reinitialisation since I doubt signature-pad is made to handle changes in cavas size, but it shouldn't be that bad. |
Implemented in #20 . Would appreciate any help testing out v1.0.0-alpha.1 in production environments since there might some hidden behaviors or edge cases I missed or something |
When I originally forked
react-signature-pad
, I did not particularly diff the code with the originalsignature_pad
and just made changes downstream as needed. Having looked more closely atsignature_pad
in recent months (due to the discussion in #8 ), it looks like all of the code is backward-compatible (even the 2.0.0 release is just a dist change which does not break the API).I propose that this library import
signature_pad
and effectively just act as a wrapper implementing certain helper functions like trimming and resizing (as it currently does). All props would be passed directly to thesignature_pad
instance. In order to preserve auto-updating props, acomponentWillReceiveProps
hook would need to be made that updates the instance's internal variables. I don't think there would be anything backwards-incompatible this way, but I may be wrong (there may be some gimmicks in resize). It may need to pin to patch versions only for now as minor version changes could break the wrapping layer due to internal usage (e.g.opts.ratio
,opts.width
,opts.height
).This would add a whole host of new functionality, such as adding an SVG option as requested in #12 , as well as fix lots of bugs, such as the
isEmpty
bug in #16 , and would overall reduce maintenance burden and the general surface area of this library and its API.The text was updated successfully, but these errors were encountered: