View Source PlausibleWeb.Live.FunnelSettings.ComboBox (Plausible v0.0.1)

Phoenix LiveComponent for a combobox UI element with search and selection functionality.

The component allows users to select an option from a list of options, which can be searched by typing in the input field.

The component renders an input field with a dropdown anchor and a hidden input field for submitting the selected value.

The number of options displayed in the dropdown is limited to 15 by default but can be customized. When a user types into the input field, the component searches the available options and provides suggestions based on the input.

Link to this section Summary

Functions

Attributes

  • ref (:string) (required)
  • options (:list) - Defaults to [].
  • suggestions (:list) - Defaults to [].
  • target (:any)

Attributes

  • id (:any) (required)

Attributes

  • display_value (:string) (required)
  • submit_value (:integer) (required)
  • ref (:string) (required)
  • target (:any)
  • idx (:integer) (required)

Attributes

  • placeholder (:string) - Defaults to "Select option or search by typing".
  • id (:any) (required)
  • options (:list) (required)
  • submit_name (:string) (required)
  • display_value (:string) - Defaults to "".
  • submit_value (:string) - Defaults to "".

Link to this section Functions

Link to this function

handle_event(binary, params, socket)

View Source

Callback implementation for Phoenix.LiveComponent.handle_event/3.

attributes

Attributes

  • display_value (:string) (required)
  • submit_value (:integer) (required)
  • ref (:string) (required)
  • target (:any)
  • idx (:integer) (required)

attributes

Attributes

  • placeholder (:string) - Defaults to "Select option or search by typing".
  • id (:any) (required)
  • options (:list) (required)
  • submit_name (:string) (required)
  • display_value (:string) - Defaults to "".
  • submit_value (:string) - Defaults to "".
Link to this function

select_option(js \\ %JS{}, id, submit_value, display_value)

View Source

Callback implementation for Phoenix.LiveComponent.update/2.