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
Provide a way to get a reference to the currently showing modal page instance. #727
Comments
Hey @NathanaelA , you will have to use the instance method https://github.com/NativeScript/NativeScript/blob/master/ui/core/view.d.ts#L393 instead of the static one. |
This comment was marked as abuse.
This comment was marked as abuse.
Hey, @NathanaelA , we misunderstood you question - sorry about that! The modal page cannot be accessed like that and it has nothing to do with the frame.topmost(), because it is not part of the navigation stack. Can you give us some more information about you are trying to achieve, so we can be more of a help? :) |
This comment was marked as abuse.
This comment was marked as abuse.
OK. I will try to implement a frame.getModal() method. |
Since a modal page always has a parent page, I decided to add a new property to the Page class called "modal". Getting it will return the currently shown modal page if any. So you could get it like this:
|
|
Fixed #727: Provide a way to get a reference to the currently showin…
@hamorphis This seems to be not working anymore. currentPage has no modal on it. |
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. |
There does not seem to be an equivalent way to get the current modal view that is running like you can get the current non-modal page from the frame.topmost(). With the frame.topmost() you can do view.getViewById(frame.topmost(), "id") and find an id somewhere on the running non-modal page.
However, if a modal page is up; it is not included in the search. Is their another technique other than capturing the modal page object on the loaded event? (i.e. so if I have a library that auto-searches for something it can find it if it is a normal page or a modal page).
Did I miss something, or does the frame code need some addition code to allow the modal pages to be included in a modal stack so that the search can find it?
The text was updated successfully, but these errors were encountered: