Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Setting page.css will affect other pages in the app #8143

Copy link
Copy link
Open
@vakrilov

Description

@vakrilov
Issue body actions

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

  1. Click Navigate Leak
  2. Click the button on the new page - it will set the page background
  3. Go back -> the background on the start page is also set

Expected behavior
Use the same playground:

  1. Click Navigate No Leak
  2. Click the button on the new page - it will set the page background
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.