microsoft / microsoft/fluentui-blazor
[dev-v5] fix: Focus on page navigation
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 4.8k
- Forks
- 483
- Avg merge
- 14h 41m
- Merged PRs (30d)
- 68
Description
🐛 Bug Report
There is a weird glitch when using the Autofocus parameter for input components. Whenever a page navigation is happening then autofocus will be ignored.
For some reason this is not the case in the demo project but I couldn't figure out why.
This issue might be related to #4699
💻 Repro or Code Sample
https://github.com/MarvinKlein1508/FluentUI-Autofocs-navigation-issue
- Run the project
- Click on counter
- See that the input is not focused
- press f5
- see the input will be focused
For the demos use: https://github.com/MarvinKlein1508/fluentui-blazor/tree/focus-issue
- Navigate to /Debug/Test
- Click any of the links/buttons
- See element will be focused
🤔 Expected Behavior
I expect the input to be focused
😯 Current Behavior
The element won't be focused in a blank fluent ui app.
💁 Possible Solution
🔦 Context
🌍 Your Environment
- OS & Device: Windows 11 64 Bit
- Browser latest Firefox, Egde & Chrome
- latest dev-v5 branch
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the linked Autofocus navigation repro and reproduce the failure by clicking counter, then compare it with the demos at /Debug/Test on the focus-issue branch. Trace the Autofocus behavior during page navigation and verify that the input receives focus after navigation in a blank Fluent UI app without requiring a refresh.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100