FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix(modal): parent page invalid hierarchy handling by NathanWalker · Pull Request #5841 · NativeScript/NativeScript · GitHub

fix(modal): parent page invalid hierarchy handling - #5841

Closed
NathanWalker wants to merge 1 commit into
NativeScript:masterfrom
NathanWalker:fix-modal-handling
Closed

NathanWalker wants to merge 1 commit into
NativeScript:masterfrom
NathanWalker:fix-modal-handling

Conversation

NathanWalker commented May 20, 2018 •
edited
Loading

Copy link
Copy Markdown
Contributor

PR Checklist

What is the current behavior?

Apps break with the current throw without any effective way to handle. Additionally a while loop was being used without safe guards to prevent undefined access.

What is the new behavior?

With tracing on, developers can now properly debug their apps for various use cases without an untested (and most often not reproducible) ux flow/interaction hitting production resulting in this throw leaving the app unstable and unpredictable. Also proper safe guards have been added to prevent undefined access.

// ensure view is protected against undefined access at each turn
if (view) {
view = view.parent as View;
if (view) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Without this being guarding this while loop was very dangerous. Would often result in:

ERROR Error: Uncaught (in promise): TypeError: undefined is not an object (evaluating 'view.viewController')
getParentWithViewController@file:///app/tns_modules/tns-core-modules/ui/core/view/view.js:251:30
_showNativeModalView@file:///app/tns_modules/tns-core-modules/ui/core/view/view.js:257:68
showModal@file:///app/tns_modules/tns-core-modules/ui/core/view/view-common.js:195:38

NathanWalker referenced this pull request May 30, 2018
#5881)

* fix(ios-dialogs): unable to show dialog from modal view

* tests(modal-navigation): add test that opens dialog inside modal view
NathanWalker force-pushed the fix-modal-handling branch 5 times, most recently from 84b37b4 to d553929 Compare June 1, 2018 01:03

Copy link
Copy Markdown
Contributor

Hey @NathanWalker - I've extended this PR in #5966

Copy link
Copy Markdown
Contributor Author

Closing in favor of #5966

ghost removed the ♥ community PR label Jun 20, 2018

lock Bot commented Aug 26, 2019

Copy link
Copy Markdown

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

lock Bot locked and limited conversation to collaborators Aug 26, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL