From 1989d58b69f0b7a3c759af7f34237a99454debfb Mon Sep 17 00:00:00 2001 From: Qluxzz Date: Tue, 19 Mar 2024 21:41:52 +0100 Subject: [PATCH] Make buttons divs --- src/Game.elm | 6 +++--- style.css | 8 ++++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/Game.elm b/src/Game.elm index c114aad..aa2ac62 100644 --- a/src/Game.elm +++ b/src/Game.elm @@ -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) ] @@ -304,7 +304,7 @@ keyboardView triedLetters canSubmit canClear = clearButton : Html Msg clearButton = - button + div [ HA.classList [ ( "disabled", not canClear ) ] , HE.onClick RemoveChar ] @@ -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" diff --git a/style.css b/style.css index cae1980..fcf1453 100644 --- a/style.css +++ b/style.css @@ -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; @@ -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;