MudPopover: Remove MudGlobal.PopoverDefaults and move properties to PopoverOptions#12286
Conversation
Co-authored-by: danielchalmers <[email protected]>
|
@versile2 Does this seem like a sensible change on the surface? |
Co-authored-by: danielchalmers <[email protected]>
|
I'm not seeing a test where he would change the service options, on the DI level and that component that would pick it up? |
|
This does not implement the new PopoverOptions at all, it creates 2 popover options that are never used as far as I can tell. |
Yeah, what is it thinking? Lol. Sorry, I should've checked the implementation instead of just the API surface |
|
@copilot You need to actually hook up ModalOverlay and OverflowBehavior from PopoverOptions in the components. Right now it's just using the default values. Also ensure that those values on both the component and global level are appropriately tested. |
…ection Co-authored-by: danielchalmers <[email protected]>
Implemented in commit 8772e7d. Components now:
Added tests verifying both global defaults from |
|
I guess creating protected OverflowBehavior GetOverflowBehavior() => OverflowBehavior ?? PopoverService.PopoverOptions.OverflowBehavior;is one of the available options that doesn't violate any Blazor rules. I know that in .NET 9, they finally added constructor injection as an alternative to property injection (which is set only after the component is constructed). You should be able to set the defaults in the constructor, but since we support .NET 8, I’m not sure if that’s available there. If not, it’s probably best to leave a TODO note to rewrite this once .NET 8 support is dropped, as it will be much simpler. |
|
Seems the flaky |
|
@copilot you didn't add the new properties to ServiceCollectionExtensionsTests |
ModalOverlayandOverflowBehaviorproperties toPopoverOptionsMudGlobal.PopoverDefaultsclass fromMudGlobal.csPopoverOptionsvia DI:IPopoverServiceintoMudMenu,MudAutocomplete,MudSelect,MudPickerModalandOverflowBehaviorparameters to nullable typesGetModal()andGetOverflowBehavior()resolver methods that fall back toPopoverOptionsServiceCollectionExtensions.csto pass new properties to popover serviceAddMudPopoverService_ShouldRegisterServices_WithOptionsActionAddMudServices_ShouldRegisterAllServices_WithOptionsActionPopoverOptionsare properly picked upOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.