Skip to main content

repeatable_remove_button

Function repeatable_remove_button 

Source
pub fn repeatable_remove_button<V: 'static>(
    id: impl Into<SharedString>,
    focus_handle: &FocusHandle,
    theme: &Theme,
    enabled: bool,
    is_focused: bool,
    on_action_activate: impl Fn(&mut V, &mut Window, &mut Context<'_, V>) + 'static,
    on_click_activate: impl Fn(&mut V, &mut Window, &mut Context<'_, V>) + 'static,
    cx: &mut Context<'_, V>,
) -> Stateful<Div>
Expand description

Render a repeatable widget remove button (minus icon).

Creates a 28x28 button with a horizontal minus sign, styled according to the theme. Handles focus, hover states, and disabled styling.

§Arguments

  • id - Unique element ID for the button
  • focus_handle - Focus handle for keyboard navigation
  • theme - Theme for colors
  • enabled - Whether the button is interactive
  • is_focused - Whether the button currently has focus
  • on_action_activate - Callback for action handler (should set action_just_handled = true)
  • on_click_activate - Callback for click handler (should check/reset action_just_handled)
  • cx - Context for creating listeners

§Double-Trigger Prevention

The two separate callbacks allow the caller to implement the action_just_handled pattern. See the module-level comment for why this is critical.