@@ -180,18 +180,11 @@ public partial class Typeahead<TItem, TValue> : StandardComponent
180180 public FieldIdentifier FieldIdentifier { get ; set ; }
181181
182182 /// <summary>
183- /// Gets or sets the explicit width of the dropdown menu. When not set, the menu matches the control width.
184- /// Accepts any valid CSS width value (e.g., <c>"300px"</c>, <c>"20rem"</c>).
183+ /// Gets or sets the explicit style of the dropdown menu. When not set, the menu matches the control width.
184+ /// Accepts any valid CSS style value (e.g., <c>"width: 300px; "</c>, <c>"width: 20rem; "</c>).
185185 /// </summary>
186186 [ Parameter ]
187- public string ? MenuWidth { get ; set ; }
188-
189- /// <summary>
190- /// Gets or sets the anchor edge from which the dropdown menu is aligned.
191- /// Defaults to <see cref="MenuAnchor.Left"/>.
192- /// </summary>
193- [ Parameter ]
194- public MenuAnchor MenuAnchor { get ; set ; } = MenuAnchor . Left ;
187+ public string ? MenuStyle { get ; set ; }
195188
196189 /// <summary>
197190 /// Gets a value indicating whether the control is currently loading search results.
@@ -235,7 +228,7 @@ public partial class Typeahead<TItem, TValue> : StandardComponent
235228 protected List < TItem > CurrentItems { get ; set ; } = [ ] ;
236229
237230 /// <summary>
238- /// Gets the computed inline style applied to the dropdown menu, derived from <see cref="MenuWidth"/> and <see cref="MenuAnchor "/>.
231+ /// Gets the computed inline style applied to the dropdown menu, derived from <see cref="MenuStyle "/>.
239232 /// </summary>
240233 protected string ? CurrentMenuStyle { get ; private set ; }
241234
@@ -260,9 +253,7 @@ protected override void OnParametersSet()
260253 CurrentMenuStyle = StyleBuilder . Pool . Use ( builder =>
261254 {
262255 return builder
263- . AddStyle ( "width" , MenuWidth , ( v ) => v . HasValue ( ) )
264- . AddStyle ( "left" , "0" , MenuAnchor is MenuAnchor . Left )
265- . AddStyle ( "right" , "0" , MenuAnchor is MenuAnchor . Right )
256+ . AddStyle ( MenuStyle )
266257 . ToString ( ) ;
267258 } ) ;
268259 }
@@ -600,14 +591,3 @@ private void MoveSelection(int count)
600591 throw new InvalidOperationException ( $ "Typeahead component requires a { nameof ( ConvertMethod ) } parameter.") ;
601592 }
602593}
603-
604- /// <summary>
605- /// Specifies the edge of the typeahead control to which the dropdown menu is anchored.
606- /// </summary>
607- public enum MenuAnchor
608- {
609- /// <summary>The menu aligns to the left edge of the control.</summary>
610- Left ,
611- /// <summary>The menu aligns to the right edge of the control.</summary>
612- Right
613- }
0 commit comments