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

The color of font icon in action bar is not changing after initial rendering #8211

Copy link
Copy link
Open
@xuhcc

Description

@xuhcc
Issue body actions

Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):

  • CLI: 6.3.0
  • Cross-platform modules: 6.3.0
  • Android Runtime: 6.3.0
  • iOS Runtime: -
  • Plugin(s): -

Describe the bug

The color of font icon in action bar is not changing after initial rendering of a page.

To Reproduce

I'm seeing this behaviour in a nativescript-angular app on Android.

HTML:

<ActionItem
    icon="font://&#xe161;"
    class="action-bar-icon"
    [class.disabled]="someCondition()"
></ActionItem>

CSS:

.action-bar-icon {
    color: #FFFFFF;
}
.disabled {
    color: #666666;
}

Expected behavior

The color of icon in action bar should change from #FFFFFF to #666666 when the condition changes.

Additional context

Currently the following workaround could be used:

<ActionBar (loaded)="onActionBarLoaded($event)">
onActionBarLoaded(event: any): void {
    const actionBar = event.object;
    someConditionObservable.subscribe(() => {
        // Delay update so it will be done after class toggle
        setTimeout(() => {
            actionBar.update();
        }, 0);
    });
}

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.