Infinite loop in SaveCommentOnBlur when Unfocused event is triggered in MAUI

Omkar Pawar 40 Reputation points
2025-01-12T18:39:33.88+00:00

In my custom MAUI entry control, the SaveCommentOnBlur method gets stuck in an infinite loop when the EntryField_Unfocused event is triggered. This causes the keyboard to hang, and either the keyboard or the app becomes unresponsive.

Steps to Reproduce:

  1. Click on the entry field and try to add or remove text.
  2. Observe that the focus event is triggered multiple times, causing an infinite loop.

Expected Behavior: The SaveCommentOnBlur method should be triggered only once, and the loss of focus should not cause any unintended loops or freezes.

Actual Behavior: The SaveCommentOnBlur method is triggered multiple times, causing an infinite loop and freezing the keyboard.

Sample Code: GitHub Repository - UnfocusedIssue

I need help resolving this.

Record_2025-01-12-23-31-00-ezgif.com-video-to-gif-converter

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,807 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.