Skip to content

fix: make SfPicker respect HorizontalOptions and VerticalOptions for adjustable layout #196

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hernanda-git
Copy link

This PR updates the internal PickerStackLayout in SfPicker to respect the HorizontalOptions and VerticalOptions properties set on the picker control. This allows the picker to be sized and aligned according to these layout options, fixing the issue where the picker did not adjust its size or alignment as expected.

  • Sets HorizontalOptions and VerticalOptions on PickerStackLayout in PickerBase.
  • No breaking changes; only layout behavior is improved.

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR ensures the internal PickerStackLayout honors the control’s HorizontalOptions and VerticalOptions, improving its sizing and alignment behavior.

  • Applies HorizontalOptions and VerticalOptions to the internal layout.
  • Fixes layout responsiveness without introducing breaking changes.
Comments suppressed due to low confidence (1)

maui/src/Picker/PickerBase.cs:242

  • There are no tests verifying that the picker respects HorizontalOptions and VerticalOptions. Consider adding a UI or layout unit test to confirm these properties are applied correctly in various scenarios.
            _pickerStackLayout = new PickerStackLayout(this);

@@ -240,6 +240,8 @@ void UpdateFormatBasedOnCulture()
void AddChildren()
{
_pickerStackLayout = new PickerStackLayout(this);
_pickerStackLayout.HorizontalOptions = this.HorizontalOptions;
Copy link
Preview

Copilot AI Jun 24, 2025

Choose a reason for hiding this comment

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

HorizontalOptions and VerticalOptions are only set once during AddChildren. If these properties change at runtime, the layout won’t update. Consider overriding OnPropertyChanged for HorizontalOptions and VerticalOptions to reapply them on the internal layout.

Copilot uses AI. Check for mistakes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

2 participants