Skip to content

Focus manager doesn't automatically focus to the next available element when the current focused element get removed from render list (for example, when the current focused element is in @if block where its condition becomes false in next render batch) #107

@LittleLittleCloud

Description

@LittleLittleCloud

Minimal reproducable example

When hitting enter, the next rendered component didn't get highlighted correctly

@using Spectre.Console

@if (showA)
{
    <p>a</p>
    <RazorConsole.Components.TextButton
                                        Content="A"
                                        OnClick="() => showA = false"
                                        BackgroundColor="@Color.Blue"
                                        FocusedColor="@Color.Cyan1" />
}

@if (!showA)
{
    <RazorConsole.Components.TextButton Content="B"
                                        OnClick="() => showA = true"
                                        BackgroundColor="@Color.Aqua"
                                        FocusedColor="@Color.HotPink" />
}

@code {
    private Dictionary<string, object> attributeA = new Dictionary<string, object>
    {
        {"key", "a"}
    };
    private bool showA = false;
}

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions