Prevent default on Enter and add type=button to clear button element

This commit is contained in:
Tom Nunn 2023-04-10 21:17:12 +01:00
parent 7f024743db
commit a89ff160d0
2 changed files with 2 additions and 1 deletions

View File

@ -251,6 +251,7 @@ clearButtonElement onChange attribs element =
, Css.batch attribs
]
, Attributes.tabindex -1
, Attributes.type_ "button"
, Events.onClick (onChange ClearButtonPressed)
]
[ element ]

View File

@ -29,7 +29,7 @@ hijackKey :
hijackKey menuOpen tagger key =
{ message = tagger key
, stopPropagation = menuOpen && key == "Escape"
, preventDefault = List.member key [ "ArrowUp", "ArrowDown", "PageUp", "PageDown" ]
, preventDefault = List.member key [ "ArrowUp", "ArrowDown", "PageUp", "PageDown", "Enter" ]
}