timgremore commited on
Commit
96365df
1 Parent(s): 4adc7b7

fix: Position code select above content

Browse files
lib/medical_transcription_web/components/code_select.ex CHANGED
@@ -43,7 +43,7 @@ defmodule MedicodeWeb.Components.CodeSelect do
43
  ~H"""
44
  <div class="w-full" phx-click-away="clear-codes" phx-target={@myself}>
45
  <%= if is_nil(@selected_code) do %>
46
- <.form for={@form} phx-change="suggest-code" phx-target={@myself}>
47
  <.input
48
  type="text"
49
  field={@form[:search_term]}
@@ -51,23 +51,23 @@ defmodule MedicodeWeb.Components.CodeSelect do
51
  style={if length(@codes) > 0, do: "border-radius: 0.25rem 0.25rem 0 0 !important;"}
52
  placeholder="Search for another code..."
53
  />
54
- </.form>
55
 
56
- <div
57
- :if={length(@codes) > 0}
58
- class="border-l border-r border-b border-zinc-400 rounded-b overflow-hidden"
59
- >
60
- <button
61
- :for={code <- @codes}
62
- type="button"
63
- class="w-full text-left px-2 py-1 text-sm border-b border-zinc-100 last:border-b-0 hover:bg-blue-200"
64
- phx-click="choose-code"
65
- phx-value-code={code.code}
66
- phx-target={@myself}
67
  >
68
- <%= code.code %>: <%= code.description %>
69
- </button>
70
- </div>
 
 
 
 
 
 
 
 
 
71
  <% else %>
72
  <div class="px-[14px]">
73
  <div class="flex justify-between pb-1 border-b border-zinc-300">
 
43
  ~H"""
44
  <div class="w-full" phx-click-away="clear-codes" phx-target={@myself}>
45
  <%= if is_nil(@selected_code) do %>
46
+ <.form for={@form} phx-change="suggest-code" phx-target={@myself} class="relative">
47
  <.input
48
  type="text"
49
  field={@form[:search_term]}
 
51
  style={if length(@codes) > 0, do: "border-radius: 0.25rem 0.25rem 0 0 !important;"}
52
  placeholder="Search for another code..."
53
  />
 
54
 
55
+ <div
56
+ :if={length(@codes) > 0}
57
+ class="absolute z-10 w-full bg-white border-l border-r border-b border-zinc-400 rounded-b overflow-hidden"
 
 
 
 
 
 
 
 
58
  >
59
+ <button
60
+ :for={code <- @codes}
61
+ type="button"
62
+ class="w-full text-left px-2 py-1 text-sm border-b border-zinc-100 last:border-b-0 hover:bg-blue-200"
63
+ phx-click="choose-code"
64
+ phx-value-code={code.code}
65
+ phx-target={@myself}
66
+ >
67
+ <%= code.code %>: <%= code.description %>
68
+ </button>
69
+ </div>
70
+ </.form>
71
  <% else %>
72
  <div class="px-[14px]">
73
  <div class="flex justify-between pb-1 border-b border-zinc-300">