]> git.cworth.org Git - lmno.games/commitdiff
anagrams: Allow clicking on a word to steal it
authorCarl Worth <cworth@cworth.org>
Sun, 8 Mar 2026 15:44:45 +0000 (11:44 -0400)
committerCarl Worth <cworth@cworth.org>
Sun, 8 Mar 2026 15:44:45 +0000 (11:44 -0400)
In addition to dragging the word, which was already supported.

anagrams/anagrams.jsx

index 09e5f0453426702b01ac7eb67f589a2ecd46a6bc..84197bc091f12acca1f42c107ff6fac0a43496d4 100644 (file)
@@ -47,7 +47,8 @@ function WordDisplay(props) {
   return (
     <div className={"word-display" + (stealable ? " stealable" : "")}
          draggable={stealable}
-         onDragStart={stealable ? onSteal : null}>
+         onDragStart={stealable ? onSteal : null}
+         onClick={stealable ? onSteal : null}>
       {word.word.split("").map((letter, i) => (
         <Tile key={i} letter={letter} />
       ))}