🐛 Bug Report
The AutoFocus parameter does not work when a component is being rendered conditionally.
💻 Repro or Code Sample
<FluentSwitch @bind-Value="showInput" Label="Show Input" />
<br />
@if (showInput)
{
<FluentTextInput @bind-Value="test" Label="Test" Autofocus />
}
@code {
private string test = string.Empty;
private bool showInput;
}
- Run code
- Press the switch
- Notice that the input won't get focused
🤔 Expected Behavior
The input should become focused once it is visible
😯 Current Behavior
The input will become visible but won't be set in focus.
💁 Possible Solution
🔦 Context
If you just render the component without the if then it actually will get focused.
🌍 Your Environment
- OS & Device: Windows 11 64 Bit
- Browser latest Firefox, Chrome, Edge
- latest dev-v5 branch
🐛 Bug Report
The
AutoFocusparameter does not work when a component is being rendered conditionally.💻 Repro or Code Sample
🤔 Expected Behavior
The input should become focused once it is visible
😯 Current Behavior
The input will become visible but won't be set in focus.
💁 Possible Solution
🔦 Context
If you just render the component without the
ifthen it actually will get focused.🌍 Your Environment