Open
Description
Environment
- Cross-platform modules: 6.2
Describe the bug
Setting the css
property on page will apply styles globally when the page does not have a css file.
To Reproduce
Playground link: https://play.nativescript.org/?template=play-tsc&id=OvZEeJ
- Click
Navigate Leak
- Click the button on the new page - it will set the page background
- Go back -> the background on the start page is also set
Expected behavior
Use the same playground:
- Click
Navigate No Leak
- Click the button on the new page - it will set the page background
- Go back -> the initial page is not affected
Additional context
When a page has a CSS file it is always a style-host and has its own StyleScope
created. When setting the CSS it is used and styles does not leak.
When a page has no CSS files - it uses the StyleScope
from its parent to when setting CSS and it is applied to other pages in the same frame.