Skip to content

Commit

Permalink
Tweaks for MacCatalyst
Browse files Browse the repository at this point in the history
Remove focus effect from Input and AutoComplete when running on MacCatalyst. Set UIButton.Configuration in DropdownHandler to make the OS render it with the drop down arrows.
  • Loading branch information
rdurfee committed Aug 5, 2024
1 parent eae1bbe commit 9f71458
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -399,4 +399,8 @@ FodyWeavers.xsd

# DocFx
_site/
api/
api/

# Mac resource files
.DS_Store
**/.DS_Store
6 changes: 6 additions & 0 deletions src/UraniumUI.Material/Controls/InputField.cs
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,12 @@ protected override void OnHandlerChanged()
#if ANDROID
Loaded += OnLoaded;
#endif
#if MACCATALYST
if (OperatingSystem.IsIOSVersionAtLeast(15) && Content.Handler.PlatformView is UIKit.UITextField textview)
{
textview.FocusEffect = null;
}
#endif

Content.Focused += OnFocusChanged;
Content.Unfocused += OnFocusChanged;
Expand Down
5 changes: 4 additions & 1 deletion src/UraniumUI/Handlers/AutoCompleteViewHandler.Apple.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ protected override UIAutoCompleteTextField CreatePlatformView()
view.Text = VirtualView.Text;
view.TextColor = VirtualView.TextColor.ToPlatform();
view.ReturnKeyType = UIReturnKeyType.Done;

if (OperatingSystem.IsIOSVersionAtLeast(15))
{
view.FocusEffect = null;
}


view.AutoCompleteViewSource.Selected += AutoCompleteViewSourceOnSelected;
Expand Down
2 changes: 2 additions & 0 deletions src/UraniumUI/Handlers/DropdownHandler.Apple.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ protected override UIKit.UIButton CreatePlatformView()
if (UIDevice.CurrentDevice.CheckSystemVersion(15, 0))
{
button.ChangesSelectionAsPrimaryAction = true;
var configuration = UIButtonConfiguration.PlainButtonConfiguration;
button.Configuration = configuration;
}


Expand Down

0 comments on commit 9f71458

Please sign in to comment.