Trigger search on Enter in search inputs inside forms
This commit is contained in:
@@ -301,7 +301,10 @@ defmodule MusicLibraryWeb.Components.RecordForm do
|
||||
name="cover_search_query"
|
||||
value={@cover_search_query}
|
||||
phx-keyup="update_cover_search_query"
|
||||
phx-keydown="search_covers"
|
||||
phx-key="Enter"
|
||||
phx-target={@myself}
|
||||
onkeydown="if(event.key==='Enter')event.preventDefault()"
|
||||
/>
|
||||
</div>
|
||||
<.button
|
||||
|
||||
@@ -92,7 +92,10 @@ defmodule MusicLibraryWeb.ArtistLive.Form do
|
||||
name="image_search_query"
|
||||
value={@image_search_query}
|
||||
phx-keyup="update_image_search_query"
|
||||
phx-keydown="search_images"
|
||||
phx-key="Enter"
|
||||
phx-target={@myself}
|
||||
onkeydown="if(event.key==='Enter')event.preventDefault()"
|
||||
/>
|
||||
</div>
|
||||
<.button
|
||||
|
||||
Reference in New Issue
Block a user