Skip to content

Commit

Permalink
fix(Combobox): Use String.contains?/2 instead of String.starts_with?/…
Browse files Browse the repository at this point in the history
…2 for search (#860)
  • Loading branch information
ischepin authored Nov 28, 2024
1 parent aa7ad9f commit 6ac7ec0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/moon/design/form/combobox.ex
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ defmodule Moon.Design.Form.Combobox do
slot(option)

defp is_hidden(option, filter) do
import String, only: [starts_with?: 2, downcase: 1]
import String, only: [contains?: 2, downcase: 1]

is_binary(filter) && String.length(filter) > 0 &&
!starts_with?(downcase(option[:key]), downcase(filter))
!contains?(downcase(option[:key]), downcase(filter))
end

def render(assigns) do
Expand Down

0 comments on commit 6ac7ec0

Please sign in to comment.