fix: set modal dialog root view parent by farfromrefug · Pull Request #10443 · NativeScript/NativeScript · GitHub | Latest TMZ Celebrity News & Gossip | Watch TMZ Live
Skip to content

fix: set modal dialog root view parent #10443

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

farfromrefug
Copy link
Collaborator

now the dialog root view has the Application rootView as parent to be able to access the ns-root class which comply with css specs (for example to read root css variables)

…le to access the `ns-root` class which comply with css specs (for example to read root css variables)
@cla-bot cla-bot bot added the cla: yes label Nov 16, 2023
on iOS as the UILayoutViewController can be used for other widget we need to let it know it is for modal so that it still loads/unloads the view (there was a test for parent).
@CatchABus
Copy link
Contributor

CatchABus commented Nov 16, 2023

now the dialog root view has the Application rootView as parent to be able to access the ns-root class which comply with css specs (for example to read root css variables)

I think it's more like a feature than a fix. Old docs state that you have to use .ns-modal for styling modal root view and children.
https://v6.docs.nativescript.org/ui/styling#root-views-css-classes

@farfromrefug
Copy link
Collaborator Author

You still can. Ns-modal only apply to modals
But without that PR you can't access root CSS variables from a modal CSS. Which you would expect ( I think). I mean the rootview of application also is the root view for modals, bottom sheet...

@CatchABus
Copy link
Contributor

CatchABus commented Nov 16, 2023

You still can. Ns-modal only apply to modals But without that PR you can't access root CSS variables from a modal CSS. Which you would expect ( I think). I mean the rootview of application also is the root view for modals, bottom sheet...

I see your point but will this implementation work for the case when root view is a Frame? That class seems to have a special handling for eachChildView and it might be a problem: https://github.com/NativeScript/NativeScript/blob/main/packages/core/ui/frame/frame-common.ts#L538

UPDATED: The same applies to other views that can be used as root views.

@vallemar
Copy link
Contributor

@farfromrefug
Copy link
Collaborator Author

@vallemar yes it does. But not when you start modifying them from yes. From what you have root and modal properties are actually not the same

@farfromrefug
Copy link
Collaborator Author

@CatchABus it should not change anything. EachChild and parent are decoupled. Setting the parent does not imply it will be in eachChild. It won't !

CatchABus
CatchABus previously approved these changes Nov 16, 2023
@NathanWalker NathanWalker added this to the 8.8 milestone Jun 28, 2024
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.

4 participants

TMZ Celebrity News – Breaking Stories, Videos & Gossip

Looking for the latest TMZ celebrity news? You've come to the right place. From shocking Hollywood scandals to exclusive videos, TMZ delivers it all in real time.

Whether it’s a red carpet slip-up, a viral paparazzi moment, or a legal drama involving your favorite stars, TMZ news is always first to break the story. Stay in the loop with daily updates, insider tips, and jaw-dropping photos.

🎥 Watch TMZ Live

TMZ Live brings you daily celebrity news and interviews straight from the TMZ newsroom. Don’t miss a beat—watch now and see what’s trending in Hollywood.