@@ -68,15 +68,15 @@ pub struct DropdownMenuProps {
6868/// DropdownMenu { default_open: false,
6969/// DropdownMenuTrigger { "Open Menu" }
7070/// DropdownMenuContent {
71- /// DropdownMenuItem {
71+ /// DropdownMenuItem::<String> {
7272/// value: "edit".to_string(),
7373/// index: 0usize,
7474/// on_select: move |value| {
7575/// tracing::info!("Selected: {}", value);
7676/// },
7777/// "Edit"
7878/// }
79- /// DropdownMenuItem {
79+ /// DropdownMenuItem::<String> {
8080/// value: "undo".to_string(),
8181/// index: 1usize,
8282/// disabled: true,
@@ -183,15 +183,15 @@ pub struct DropdownMenuTriggerProps {
183183/// DropdownMenu { default_open: false,
184184/// DropdownMenuTrigger { "Open Menu" }
185185/// DropdownMenuContent {
186- /// DropdownMenuItem {
186+ /// DropdownMenuItem::<String> {
187187/// value: "edit".to_string(),
188188/// index: 0usize,
189189/// on_select: move |value| {
190190/// tracing::info!("Selected: {}", value);
191191/// },
192192/// "Edit"
193193/// }
194- /// DropdownMenuItem {
194+ /// DropdownMenuItem::<String> {
195195/// value: "undo".to_string(),
196196/// index: 1usize,
197197/// disabled: true,
@@ -281,15 +281,15 @@ pub struct DropdownMenuContentProps {
281281/// DropdownMenu { default_open: false,
282282/// DropdownMenuTrigger { "Open Menu" }
283283/// DropdownMenuContent {
284- /// DropdownMenuItem {
284+ /// DropdownMenuItem::<String> {
285285/// value: "edit".to_string(),
286286/// index: 0usize,
287287/// on_select: move |value| {
288288/// tracing::info!("Selected: {}", value);
289289/// },
290290/// "Edit"
291291/// }
292- /// DropdownMenuItem {
292+ /// DropdownMenuItem::<String> {
293293/// value: "undo".to_string(),
294294/// index: 1usize,
295295/// disabled: true,
@@ -332,9 +332,9 @@ pub fn DropdownMenuContent(props: DropdownMenuContentProps) -> Element {
332332
333333/// The props for the [`DropdownMenuItem`] component
334334#[ derive( Props , Clone , PartialEq ) ]
335- pub struct DropdownMenuItemProps {
335+ pub struct DropdownMenuItemProps < T : Clone + PartialEq + ' static > {
336336 /// The value of the item, which will be passed to the `on_select` callback when clicked.
337- pub value : ReadOnlySignal < String > ,
337+ pub value : ReadOnlySignal < T > ,
338338 /// The index of the item within the [`DropdownMenuContent`]. This is used to order the items for keyboard navigation.
339339 pub index : ReadOnlySignal < usize > ,
340340
@@ -345,7 +345,7 @@ pub struct DropdownMenuItemProps {
345345
346346 /// The callback function that will be called when the item is selected. The value of the item will be passed as an argument.
347347 #[ props( default ) ]
348- pub on_select : Callback < String > ,
348+ pub on_select : Callback < T > ,
349349
350350 /// Additional attributes to apply to the item element.
351351 #[ props( extends = GlobalAttributes ) ]
@@ -372,15 +372,15 @@ pub struct DropdownMenuItemProps {
372372/// DropdownMenu { default_open: false,
373373/// DropdownMenuTrigger { "Open Menu" }
374374/// DropdownMenuContent {
375- /// DropdownMenuItem {
375+ /// DropdownMenuItem::<String> {
376376/// value: "edit".to_string(),
377377/// index: 0usize,
378378/// on_select: move |value| {
379379/// tracing::info!("Selected: {}", value);
380380/// },
381381/// "Edit"
382382/// }
383- /// DropdownMenuItem {
383+ /// DropdownMenuItem::<String> {
384384/// value: "undo".to_string(),
385385/// index: 1usize,
386386/// disabled: true,
@@ -400,7 +400,9 @@ pub struct DropdownMenuItemProps {
400400/// The [`DropdownMenuItem`] component defines the following data attributes you can use to control styling:
401401/// - `data-disabled`: Indicates whether the item is disabled. Values are `true` or `false`.
402402#[ component]
403- pub fn DropdownMenuItem ( props : DropdownMenuItemProps ) -> Element {
403+ pub fn DropdownMenuItem < T : Clone + PartialEq + ' static > (
404+ props : DropdownMenuItemProps < T > ,
405+ ) -> Element {
404406 let mut ctx: DropdownMenuContext = use_context ( ) ;
405407
406408 let disabled = move || ( ctx. disabled ) ( ) || ( props. disabled ) ( ) ;
0 commit comments