Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Maui.Controls.Sample.Issues.EditorTextChangedIOS26">

<ContentPage.Content>
<VerticalStackLayout Padding="20" Spacing="10">
<Label Text="Type text in the editor below. The counter should update as you type."
FontSize="14"
Margin="0,0,0,10"/>

<Editor x:Name="TestEditor"
AutomationId="TestEditor"
Placeholder="Type here to test TextChanged event"
HeightRequest="150"
TextChanged="OnEditorTextChanged"/>

<Label x:Name="EventCountLabel"
AutomationId="EventCountLabel"
Text="TextChanged event count: 0"
FontSize="16"
FontAttributes="Bold"
TextColor="Green"/>

<Label x:Name="LastTextLabel"
AutomationId="LastTextLabel"
Text="Last text: (empty)"
FontSize="14"
TextColor="Blue"/>
</VerticalStackLayout>
</ContentPage.Content>
</ContentPage>
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
namespace Maui.Controls.Sample.Issues
{
[Issue(IssueTracker.Github, 0, "Editor TextChanged event not firing on iOS 26.1 release build",
Copy link

Copilot AI Nov 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Issue attribute uses 0 for the issue number, but according to the PR description, this PR fixes issue #32651. The issue number in the Issue attribute should be updated to match the actual GitHub issue number.

Update the issue number from:

[Issue(IssueTracker.Github, 0, "Editor TextChanged event not firing on iOS 26.1 release build",
    PlatformAffected.iOS)]

To:

[Issue(IssueTracker.Github, 32651, "Editor TextChanged event not firing on iOS 26.1 release build",
    PlatformAffected.iOS)]
Suggested change
[Issue(IssueTracker.Github, 0, "Editor TextChanged event not firing on iOS 26.1 release build",
[Issue(IssueTracker.Github, 32651, "Editor TextChanged event not firing on iOS 26.1 release build",

Copilot uses AI. Check for mistakes.
PlatformAffected.iOS)]
public partial class EditorTextChangedIOS26 : ContentPage
{
private int _eventCount = 0;

public EditorTextChangedIOS26()
{
InitializeComponent();
}

private void OnEditorTextChanged(object sender, TextChangedEventArgs e)
{
_eventCount++;
EventCountLabel.Text = $"TextChanged event count: {_eventCount}";
LastTextLabel.Text = $"Last text: {(string.IsNullOrEmpty(e.NewTextValue) ? "(empty)" : e.NewTextValue)}";
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;

namespace Microsoft.Maui.TestCases.Tests.Issues
{
internal class EditorTextChangedIOS26 : _IssuesUITest
{
public override string Issue => "Editor TextChanged event not firing on iOS 26.1 release build";

public EditorTextChangedIOS26(TestDevice device) : base(device)
{
}

[Test]
[Category(UITestCategories.Editor)]
public void EditorTextChangedEventShouldFireOnTextInput()
{
// Wait for the editor to be visible
App.WaitForElement("TestEditor");

// Verify initial state
var initialCount = App.FindElement("EventCountLabel").GetText();
Assert.That(initialCount, Is.EqualTo("TextChanged event count: 0"));

// Type text in the editor
App.Tap("TestEditor");
App.EnterText("TestEditor", "Hello");

// Wait a bit for the event to fire
App.WaitForElement("EventCountLabel");

// Verify that TextChanged event was fired
var eventCount = App.FindElement("EventCountLabel").GetText();
Assert.That(eventCount, Does.Contain("TextChanged event count:"));

// The count should be greater than 0, indicating the event fired
// Extract the number from "TextChanged event count: X"
var countText = eventCount.Replace("TextChanged event count:", "").Trim();
int count = int.Parse(countText);
Assert.That(count, Is.GreaterThan(0), "TextChanged event should have fired at least once");

// Verify the text was captured
var lastText = App.FindElement("LastTextLabel").GetText();
Assert.That(lastText, Does.Contain("Hello"), "Last text should contain the entered text");
}
}
}
1 change: 1 addition & 0 deletions src/Core/src/Platform/iOS/MauiTextView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ void HidePlaceholderIfTextIsPresent(string? value)
_placeholderLabel.Hidden = !string.IsNullOrEmpty(value);
}

[UnconditionalSuppressMessage("Memory", "MEM0003", Justification = "Event handler for UITextView.Changed - proven safe in test: MemoryTests.HandlerDoesNotLeak")]
void OnChanged(object? sender, EventArgs e)
{
HidePlaceholderIfTextIsPresent(Text);
Expand Down
Loading