mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-21 18:08:25 +00:00
Start search by pressing enter and not on each stroke
This reduces (unecessary) requests and eases the restless list rendering. Throttling is still in place to avoid too many requests when e.g. holding the enter-key.
This commit is contained in:
@ -9,6 +9,7 @@ module Util.Html exposing
|
||||
, onDragOver
|
||||
, onDropFiles
|
||||
, onKeyUp
|
||||
, onKeyUpCode
|
||||
)
|
||||
|
||||
import File exposing (File)
|
||||
@ -76,6 +77,11 @@ onKeyUp tagger =
|
||||
on "keyup" (D.map tagger keyCode)
|
||||
|
||||
|
||||
onKeyUpCode : (Maybe KeyCode -> msg) -> Attribute msg
|
||||
onKeyUpCode tagger =
|
||||
onKeyUp (intToKeyCode >> tagger)
|
||||
|
||||
|
||||
onClickk : msg -> Attribute msg
|
||||
onClickk msg =
|
||||
Html.Events.preventDefaultOn "click" (D.map alwaysPreventDefault (D.succeed msg))
|
||||
|
Reference in New Issue
Block a user