Skip to content

[MAUI] - iOS SearchBar ignores WidthRequest and HeightRequest property values #27427

@prakashKannanSf3972

Description

@prakashKannanSf3972

Description

The SearchBar control fails to respect explicitly defined Height and Width property values.

Expected Behavior:

  • SearchBar should render with the dimensions specified through Height and Width properties
  • The control should maintain these defined dimensions regardless of available container space

Android

Image

Actual Behavior:

  • SearchBar expands to fill the entire available space in its container
  • Explicitly set Height and Width properties are ignored - The control always defaults to the maximum available dimensions

iOS

Image

Mac

Image

Steps to Reproduce

Add the following XAML code

<StackLayout>
       <VerticalStackLayout
           Padding="30,0"
           Spacing="25">
           <SearchBar 
                      Placeholder="Search..."
                      WidthRequest="200"/>
       </VerticalStackLayout>

       <HorizontalStackLayout>
           <SearchBar 
                      Placeholder="Search..."
                      HeightRequest="200"/>
       </HorizontalStackLayout>
</StackLayout>

Observe that:

  • The first SearchBar ignores the WidthRequest="200" and spans the full width
  • The second SearchBar ignores the HeightRequest="200" and maintains default height

Link to public reproduction project repository

No response

Version with bug

9.0.30 SR3

Is this a regression from previous behavior?

No, this is something new

Last version that worked well

Unknown/Other

Affected platforms

iOS, macOS

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

Metadata

Metadata

Labels

area-controls-searchbarSearchBar controlp/2Work that is important, but is currently not scheduled for releasepartner/syncfusionIssues / PR's with Syncfusion collaborationplatform/iosplatform/macosmacOS / Mac Catalystt/bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions