From 6ac7ec02f604a0df74ded713529cc1b208cab0c8 Mon Sep 17 00:00:00 2001 From: ischepin <66725344+ischepin@users.noreply.github.com> Date: Thu, 28 Nov 2024 10:14:25 +0200 Subject: [PATCH] fix(Combobox): Use String.contains?/2 instead of String.starts_with?/2 for search (#860) --- lib/moon/design/form/combobox.ex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/moon/design/form/combobox.ex b/lib/moon/design/form/combobox.ex index ce382f69e..ca668bbd5 100644 --- a/lib/moon/design/form/combobox.ex +++ b/lib/moon/design/form/combobox.ex @@ -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