-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[iOS 26] Fix SearchBar layout spacing issues for small HeightRequest values #35347
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
kubaflo
merged 6 commits into
dotnet:inflight/current
from
devanathan-vaithiyanathan:fix-35286
May 12, 2026
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
ca403ec
fix added
devanathan-vaithiyanathan 70fbe21
test case added
devanathan-vaithiyanathan cc41f44
Update SearchBarHandler.iOS.cs
devanathan-vaithiyanathan 707f2df
added snapshot for andorid and iOS
devanathan-vaithiyanathan 3c7b248
AI summary addressed
devanathan-vaithiyanathan c28ae37
Update Issue35286.cs
devanathan-vaithiyanathan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+50.8 KB
...estCases.Android.Tests/snapshots/android/VerifySearchBarHeightRequestValues.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| namespace Maui.Controls.Sample.Issues; | ||
|
|
||
| [Issue(IssueTracker.Github, 35286, "Spacing problem with SearchBar", PlatformAffected.iOS | PlatformAffected.macOS)] | ||
| public class Issue35286 : ContentPage | ||
| { | ||
| public Issue35286() | ||
| { | ||
| var content = new VerticalStackLayout | ||
| { | ||
| Padding = 10, | ||
| Spacing = 10, | ||
| Children = | ||
| { | ||
| new Label | ||
| { | ||
| Text = "SearchBar with HeightRequest=35", | ||
| AutomationId = "Issue35286Label1" | ||
| }, | ||
| // SearchBar with small HeightRequest - this should NOT have spacing issues | ||
| new SearchBar | ||
| { | ||
|
devanathan-vaithiyanathan marked this conversation as resolved.
|
||
| Placeholder = "Search with HeightRequest=35", | ||
| HeightRequest = 35, | ||
| BackgroundColor = Colors.LightBlue, | ||
| AutomationId = "Issue35286SearchBar1" | ||
| }, | ||
|
|
||
| new Label | ||
| { | ||
| Text = "SearchBar with HeightRequest=100", | ||
| AutomationId = "Issue35286Label2", | ||
| Margin = new Thickness(0, 20, 0, 0) | ||
| }, | ||
| // SearchBar with large HeightRequest - should work normally | ||
| new SearchBar | ||
| { | ||
| Placeholder = "Search with HeightRequest=100", | ||
| HeightRequest = 100, | ||
| BackgroundColor = Colors.LightBlue, | ||
| AutomationId = "Issue35286SearchBar2" | ||
| }, | ||
| } | ||
| }; | ||
|
|
||
| Content = new ScrollView { Content = content }; | ||
| } | ||
| } | ||
20 changes: 20 additions & 0 deletions
20
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue35286.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| using NUnit.Framework; | ||
| using UITest.Appium; | ||
| using UITest.Core; | ||
|
|
||
| namespace Microsoft.Maui.TestCases.Tests.Issues; | ||
|
|
||
| public class Issue35286 : _IssuesUITest | ||
| { | ||
| public Issue35286(TestDevice device) : base(device) { } | ||
|
|
||
| public override string Issue => "Spacing problem with SearchBar"; | ||
|
|
||
| [Test] | ||
| [Category(UITestCategories.SearchBar)] | ||
| public void VerifySearchBarHeightRequestValues() | ||
| { | ||
| App.WaitForElement("Issue35286Label1"); | ||
| VerifyScreenshot(); | ||
|
devanathan-vaithiyanathan marked this conversation as resolved.
|
||
| } | ||
| } | ||
Binary file added
BIN
+88.3 KB
...sts/TestCases.iOS.Tests/snapshots/ios-26/VerifySearchBarHeightRequestValues.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+54.3 KB
.../tests/TestCases.iOS.Tests/snapshots/ios/VerifySearchBarHeightRequestValues.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.