Skip to content
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

Add form editing configuration #365

Merged
merged 9 commits into from
Apr 27, 2020
Prev Previous commit
Next Next commit
Update comments
  • Loading branch information
Rad Azzouz committed Apr 23, 2020
commit ff021d24bb8aa3b0691d3f2a0decae44d0486d47
3 changes: 2 additions & 1 deletion ios/RCTPSPDFKit/RCTPSPDFKitViewManager.m
Original file line number Diff line number Diff line change
@@ -33,7 +33,7 @@ @implementation RCTPSPDFKitViewManager
view.pdfController.document.defaultAnnotationUsername = view.annotationAuthorName;
}

// The `disableFormEditing` property may be set before the document exists. We set it again here when the document exists.
// Disable form editing when the document exists.
if (view.disableFormEditing) {
view.pdfController.document.formsEnabled = !view.disableFormEditing;
}
@@ -49,6 +49,7 @@ @implementation RCTPSPDFKitViewManager
}];

// The `disableFormEditing` property can be used as both a view prop and a configuration option.
// Here we set the view property with the value of the configuration option.
NSDictionary *dictionary = [RCTConvert NSDictionary:json];
if (dictionary[@"disableFormEditing"]) {
view.disableFormEditing = [RCTConvert BOOL:dictionary[@"disableFormEditing"]];