add type="button" to tab only when it's a button

This commit is contained in:
charbelrami 2022-08-08 11:05:42 -03:00
parent a0dd686510
commit a8915aa051

View File

@ -119,7 +119,8 @@ viewTab_ config index tab =
Nothing ->
-- This is for a non-SPA view
( Html.button
, [ Events.onClick (config.focusAndSelect { select = tab.id, focus = Nothing })
, [ Attributes.type_ "button"
, Events.onClick (config.focusAndSelect { select = tab.id, focus = Nothing })
]
)
@ -136,7 +137,6 @@ viewTab_ config index tab =
Attributes.disabled (not isSelected && tab.disabled)
, Aria.selected isSelected
, Role.tab
, Attributes.type_ "button"
, Attributes.id (tabToId tab.idString)
, Events.on "keyup" <|
Json.Decode.andThen (keyEvents config tab) Events.keyCode