(props: DropdownMenuContentProps)
| 332 | /// - `data-state`: Indicates the current state of the dropdown menu. values are `open` or `closed`. |
| 333 | #[component] |
| 334 | pub fn DropdownMenuContent(props: DropdownMenuContentProps) -> Element { |
| 335 | let ctx: DropdownMenuContext = use_context(); |
| 336 | |
| 337 | let unique_id = use_unique_id(); |
| 338 | let id = use_id_or(unique_id, props.id); |
| 339 | let render = use_animated_open(id, ctx.open); |
| 340 | |
| 341 | rsx! { |
| 342 | if render() { |
| 343 | div { |
| 344 | id, |
| 345 | role: "listbox", |
| 346 | aria_labelledby: "{ctx.trigger_id}", |
| 347 | "data-state": if (ctx.open)() { "open" } else { "closed" }, |
| 348 | onpointerdown: move |event| { |
| 349 | // The user is starting a click inside the dropdown menu. |
| 350 | // Prevent the blur event from occurring during pointerdown, |
| 351 | // to keep the dropdown menu open until pointerup happens, |
| 352 | // thus enabling onclick/onselect events to fire. |
| 353 | event.prevent_default(); |
| 354 | event.stop_propagation(); |
| 355 | }, |
| 356 | ..props.attributes, |
| 357 | {props.children} |
| 358 | } |
| 359 | } |
| 360 | } |
| 361 | } |
| 362 | |
| 363 | /// The props for the [`DropdownMenuItem`] component |
| 364 | #[derive(Props, Clone, PartialEq)] |
nothing calls this directly
no test coverage detected