Skip to content

Commit

Permalink
Make buttons divs
Browse files Browse the repository at this point in the history
  • Loading branch information
Qluxzz committed Mar 19, 2024
1 parent 0e19471 commit 1989d58
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/Game.elm
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ keyboardView triedLetters canSubmit canClear =
letters
|> List.map
(\char ->
button
div
[ HA.style "background" (backgroundColor (Maybe.withDefault NotTried (Dict.get char triedLetters)))
, HE.onClick (CharEntered char)
]
Expand All @@ -304,7 +304,7 @@ keyboardView triedLetters canSubmit canClear =

clearButton : Html Msg
clearButton =
button
div
[ HA.classList [ ( "disabled", not canClear ) ]
, HE.onClick RemoveChar
]
Expand All @@ -313,7 +313,7 @@ keyboardView triedLetters canSubmit canClear =

submitButton : Html Msg
submitButton =
button
div
[ HA.classList [ ( "disabled", not canSubmit ) ]
, HE.onClick SubmitAttempt
, HA.style "flex-shrink" "0"
Expand Down
8 changes: 6 additions & 2 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,11 @@ body {
gap: 4px;
}

.keyboard-row>button {
/*
The keyboard buttons are div's since if they are buttons iOS will
zoom the screen if a button is pressed multiple times in rapid succession
*/
.keyboard-row>div {
font-size: 100%;
flex-grow: 1;
flex-basis: 1ch;
Expand All @@ -73,7 +77,7 @@ body {
border: 1px solid #ddd;
}

.keyboard-row>button.disabled {
.keyboard-row>div.disabled {
background: #fff;
pointer-events: none;
border: 1px solid #ddd;
Expand Down

0 comments on commit 1989d58

Please sign in to comment.