-
Notifications
You must be signed in to change notification settings - Fork 88
Description
Hello
Right now there is a problem when showing an alert in the onClick of a MenuItem. This would look to be related to facebook/react-native#10471 and is only for iOS. The long shot is that if an alert is opened while a modal is closing, the alert disappears and the app ui locks up. This persists until the app is closed, so from a user perspective, it is basically a crash.
Seeing as it's a bug in RN, it should be up to them to fix it, but seeing as the issue has been untouched by them for almost 2 years I'm not sure that can be relied upon.
Based on the discussion in the linked issue, it would appear that this is best resolved through the use of the onDismiss() callback from Modal, however that is iOS only. I wasn't really sure the best way to resolve this in the way this library works, seeing as the fix requires the use of a platform specific feature, which is what keeps me from submitting a PR, but in the meantime I am just getting around it through liberal application of setTimeout, however this makes things feel a tad laggy.
I'm not sure the library authored would prefer this to be resolved. If you don't want to put platform specific workaround code in the library (understandable), then it might be best to just expose onDismiss directly on the Menu component? That way users can make use of it external to your library.
I'm happy to throw together a PR when I have the time, but just want to be sure which method the authors would prefer first.