SfTextInputLayout Entry not focusable inside CollectionView DataTemplate until InvalidateMeasure() is called
Hello Syncfusion Team,
I have found a focus/initial layout issue with SfTextInputLayout in a .NET MAUI application.
Environment
.NET MAUI: .NET 10
Syncfusion MAUI: 33.2.13
Control:
SfTextInputLayoutScenario:
SfTextInputLayoutinside aCollectionView.ItemTemplate/DataTemplate
Problem
Inside a CollectionView.DataTemplate, an Entry hosted inside an SfTextInputLayout is visible and appears enabled, but it cannot receive focus after the page is initially loaded.
The issue is not limited to mouse/touch input. The control also cannot be reached correctly via keyboard tab navigation.
The same Entry works correctly when the SfTextInputLayout is removed.
Important Findings
I initially suspected a binding issue because the problem seemed related to empty or nullable values. However, after further testing, this does not appear to be the cause.
I tested the following:
Binding to
stringBinding to
long?Empty string values
Null values
Non-empty values
Removing all behaviors
Removing validation
Removing custom styles
Removing surrounding controls
Removing additional labels/buttons/gesture recognizers
Using
SfTextInputLayout.InputViewexplicitlySwapping the bindings between fields
Reordering the fields
Placing the fields side by side and below each other
The issue remained related to the initial creation/layout of the SfTextInputLayout inside the DataTemplate, not to the bound property itself.
Very Important Observation
If I change something in XAML while the app is running and Hot Reload is triggered, the same control becomes focusable afterwards.
Also, if I call InvalidateMeasure() on the SfTextInputLayout after it has loaded, the issue disappears.
This strongly suggests that the SfTextInputLayout is initially measured or initialized incorrectly inside the CollectionView.DataTemplate.
Simplified XAML
<CollectionView ItemsSource="{Binding Items}">
<CollectionView.ItemTemplate>
<DataTemplate x:DataType="local:MyItem">
<Grid
ColumnDefinitions="*,*"
RowDefinitions="Auto"
ColumnSpacing="8">
<syncfusion:SfTextInputLayout
Grid.Column="0"
Hint="Start">
<Entry
Keyboard="Numeric"
Text="{Binding Start}" />
</syncfusion:SfTextInputLayout>
<syncfusion:SfTextInputLayout
Grid.Column="1"
Hint="End">
<Entry
Keyboard="Numeric"
Text="{Binding End}" />
</syncfusion:SfTextInputLayout>
</Grid>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
Example Model
public class MyItem : ObservableObject
{
private long? _start;
public long? Start
{
get => _start;
set => SetProperty(ref _start, value);
}
private long? _end;
public long? End
{
get => _end;
set => SetProperty(ref _end, value);
}
}
Workaround
The following workaround fixes the issue:
public class InvalidateMeasureOnLoadedBehavior : Behavior<VisualElement>
{
protected override void OnAttachedTo(VisualElement bindable)
{
bindable.Loaded += OnLoaded;
base.OnAttachedTo(bindable);
}
protected override void OnDetachingFrom(VisualElement bindable)
{
bindable.Loaded -= OnLoaded;
base.OnDetachingFrom(bindable);
}
private void OnLoaded(object? sender, EventArgs e)
{
if (sender is VisualElement view)
{
view.InvalidateMeasure();
if (view.Parent is VisualElement parent)
parent.InvalidateMeasure();
}
}
}
Used like this:
<syncfusion:SfTextInputLayout
Grid.Column="1"
Hint="End">
<syncfusion:SfTextInputLayout.Behaviors>
<local:InvalidateMeasureOnLoadedBehavior />
</syncfusion:SfTextInputLayout.Behaviors>
<Entry
Keyboard="Numeric"
Text="{Binding End}" />
</syncfusion:SfTextInputLayout>
After this re-measure on Loaded, the contained Entry becomes focusable.
Expected Behavior
The Entry inside SfTextInputLayout should be focusable immediately after the page and the CollectionView item template are initially loaded, without requiring Hot Reload or a manual InvalidateMeasure() call.
Actual Behavior
The Entry is visible and enabled but cannot receive focus until the layout is invalidated/re-measured.
Could you please check whether this is a known issue with SfTextInputLayout inside CollectionView.DataTemplate in .NET MAUI / .NET 10, or provide a recommended official workaround?
Thank you.
Hi Björn Möller,
Thank you for reporting the issue.
We have carefully reviewed the scenario and created a simple sample using the code structure you provided. After validating on our end, we were unable to reproduce the reported issue. The Entry inside the SfTextInputLayout within the CollectionView.DataTemplate is able to receive focus as expected once the page is loaded.
For your reference, we have attached a demo video and the sample project that demonstrates the working behavior.
To help us investigate this further, could you please verify the attached sample on your side and share the following details:
- Device model name
- OS version
- Platform (Android/iOS/Windows/Mac)
- Any additional configurations or customizations applied in your project
These details will help us analyze the issue more precisely and provide you with an appropriate solution.
We look forward to your response.
Thanks!
Regards,
Tameem
Attachment: SimpleSample_545811a9.zip
- 1 Reply
- 2 Participants
-
BM Björn Möller
- Jun 18, 2026 02:03 PM UTC
- Jun 19, 2026 12:26 PM UTC