Skip to content

[Bug]: Button focus style not applied when switching pages #283

@Marcin-Lach

Description

@Marcin-Lach

Description

In application with multiple pages, when navigating across them, the button style for focused button is not applied, but when pressing "enter", correct button invoke the attached event.
This seems to happen, when before the button, there is a code-block, for example for-loop generating buttons or variable initialization.

Image

Steps to Reproduce

Here are reproduction cases with gifs presenting the issues.

https://github.com/Marcin-Lach/razorConsole-buttonsFocusIssue

  1. Run dotnet run --project ./FocusTestApp_standardButton to start the application
  2. press enter - you will go to next screen, with first button correctly marked as focused
  3. press enter - you will go back to previous page, with first button correctly marked as focused
  4. press enter again - you will be on second page, press tab twice, to select "0 Players" button
  5. press enter - you will go back to previous page, but first button will NOT be styled as focused. If you press enter however, you will go to next page again. If you press tab, second button will be marked as focused.

Expected Behavior

The button that reacts to "enter", should be styled as focused

Actual Behavior

The button that reacts to "enter", is not styled as focused.

Environment

Image

Additional Context

I saw the same behavior in project from "Showcase" - https://github.com/Skuzzle-UK/Waves
When you go to settings page, the first "-" reacts to pressing enter, but is not styles as "focused". After pressing tab, and then shift+tab, the style is applied.

Metadata

Metadata

Assignees

No one assigned

    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