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

feat: Added method topmost in RootLayout. #9826

Merged
merged 1 commit into from Mar 16, 2022

Conversation

CatchABus
Copy link
Contributor

@CatchABus CatchABus commented Mar 15, 2022

PR Checklist

What is the current behavior?

Developers have no way to get topmost view of rootlayout.

What is the new behavior?

Developers can use method topmost to get topmost view of rootlayout.
I found this quite useful when I needed to handle view closing during android backpressed event.

This method will simply return the view of the last item in popupViews array which is not accessible in TypeScript.

@cla-bot cla-bot bot added the cla: yes label Mar 15, 2022
@CatchABus CatchABus marked this pull request as draft Mar 15, 2022
@CatchABus CatchABus marked this pull request as ready for review Mar 16, 2022
@CatchABus
Copy link
Contributor Author

@CatchABus CatchABus commented Mar 16, 2022

I see there are no tests for RootLayout and it's a different case since it usually works only if it's rendered as a root-level view.
I haven't included a test since I can't think of a good way to test this component.

@NathanWalker
Copy link
Contributor

@NathanWalker NathanWalker commented Mar 16, 2022

Very handy @DimitrisRK thank you

@NathanWalker NathanWalker merged commit 3bb8fc2 into NativeScript:master Mar 16, 2022
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants