diff --git a/elixir/apps/web/lib/web/components/form_components/select_with_groups.ex b/elixir/apps/web/lib/web/components/form_components/select_with_groups.ex index 0f229e2e2..3d80c01dd 100644 --- a/elixir/apps/web/lib/web/components/form_components/select_with_groups.ex +++ b/elixir/apps/web/lib/web/components/form_components/select_with_groups.ex @@ -165,7 +165,7 @@ defmodule Web.Components.FormComponents.SelectWithGroups do autocomplete={false} class={[ input_class(), - not @disabled && "cursor-pointer", + (@disabled && "cursor-not-allowed") || "cursor-pointer", @errors != [] && input_has_errors_class() ]} value={@value_name} @@ -181,14 +181,16 @@ defmodule Web.Components.FormComponents.SelectWithGroups do
JS.toggle_attribute({"aria-expanded", "true", "false"}, to: "##{@id}-input") - |> JS.focus(to: "#select-" <> @id <> "-search-input") + unless @disabled do + JS.toggle_class("hidden", + to: "#select-#{@id}-dropdown" + ) + |> JS.toggle_attribute({"aria-expanded", "true", "false"}, to: "##{@id}-input") + |> JS.focus(to: "#select-" <> @id <> "-search-input") + end } > <.icon name="hero-chevron-up-down" class="w-5 h-5" /> @@ -202,7 +204,7 @@ defmodule Web.Components.FormComponents.SelectWithGroups do "mt-2 pb-1 px-1 space-y-0.5 z-20", "w-full bg-white", input_border_class(), - "border border-gray-200 rounded-lg", + "border border-gray-200 rounded shadow", "overflow-hidden" ]} role="listbox" @@ -213,7 +215,7 @@ defmodule Web.Components.FormComponents.SelectWithGroups do "max-h-72", "overflow-y-auto overflow-x-hidden" ]}> -
+
@id <> "-search-input"} @@ -232,7 +234,7 @@ defmodule Web.Components.FormComponents.SelectWithGroups do
<%= if @no_search_results == [] do %> @@ -261,7 +263,7 @@ defmodule Web.Components.FormComponents.SelectWithGroups do "block", "w-full py-2 px-4", "text-sm text-neutral-800", - "rounded-lg", + "rounded", "hover:bg-neutral-100", "focus:outline-none focus:bg-neutral-100", value != @value && "cursor-pointer", @@ -276,14 +278,21 @@ defmodule Web.Components.FormComponents.SelectWithGroups do checked={value == @value} class="hidden" /> -
-
-
- <%= render_slot(@option, slot_assigns) %> -
-
- <.icon name="hero-check" class="w-4 h-4" /> -
+
JS.toggle_attribute({"aria-expanded", "true", "false"}) + |> JS.focus(to: "#select-" <> @id <> "-search-input") + } + class={["flex items-center"]} + > +
+ <%= render_slot(@option, slot_assigns) %> +
+
+ <.icon name="hero-check" class="w-4 h-4" />
diff --git a/elixir/apps/web/lib/web/live/policies/edit.ex b/elixir/apps/web/lib/web/live/policies/edit.ex index 25ae7df45..fef3f5838 100644 --- a/elixir/apps/web/lib/web/live/policies/edit.ex +++ b/elixir/apps/web/lib/web/live/policies/edit.ex @@ -124,7 +124,7 @@ defmodule Web.Policies.Edit do <% end %> - (not connected to any Sites) + (not connected to any Site) 0} @@ -146,7 +146,7 @@ defmodule Web.Policies.Edit do <:no_search_results> - No resources found. Try a different search query or create a new one <.link + No Resources found. Try a different search query or create a new one <.link navigate={~p"/#{@account}/resources/new"} class={link_style()} >here. diff --git a/elixir/apps/web/lib/web/live/policies/new.ex b/elixir/apps/web/lib/web/live/policies/new.ex index 648ecc711..cc26ace44 100644 --- a/elixir/apps/web/lib/web/live/policies/new.ex +++ b/elixir/apps/web/lib/web/live/policies/new.ex @@ -113,7 +113,7 @@ defmodule Web.Policies.New do <% end %> - (not connected to any Sites) + (not connected to any Site) 0} @@ -135,7 +135,7 @@ defmodule Web.Policies.New do <:no_search_results> - No resources found. Try a different search query or create a new one <.link + No Resources found. Try a different search query or create a new one <.link navigate={~p"/#{@account}/resources/new"} class={link_style()} >here.