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

fix: set modal dialog root view parent #10443

Open
wants to merge 5 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.

@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
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

4 participants