Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call onClueSelected on click of cell and input to know the clue #554

Open
RJBernardo opened this issue Aug 3, 2023 · 0 comments
Open

Call onClueSelected on click of cell and input to know the clue #554

RJBernardo opened this issue Aug 3, 2023 · 0 comments

Comments

@RJBernardo
Copy link

RJBernardo commented Aug 3, 2023

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch @jaredreisinger/[email protected] for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/@jaredreisinger/react-crossword/dist/CrosswordProvider.js b/node_modules/@jaredreisinger/react-crossword/dist/CrosswordProvider.js
index 8165e51..e55772a 100644
--- a/node_modules/@jaredreisinger/react-crossword/dist/CrosswordProvider.js
+++ b/node_modules/@jaredreisinger/react-crossword/dist/CrosswordProvider.js
@@ -561,6 +561,9 @@ const CrosswordProvider = react_1.default.forwardRef(({ data, theme, onAnswerCom
                 direction = other;
             }
             setCurrentNumber((_a = cellData[direction]) !== null && _a !== void 0 ? _a : '');
+            if (onClueSelected) {
+                onClueSelected(direction, cellData[direction] ?? '');
+            }
         }
         focus();
     }, [currentDirection, focus, focused, focusedCol, focusedRow]);
diff --git a/node_modules/@jaredreisinger/react-crossword/src/CrosswordProvider.tsx b/node_modules/@jaredreisinger/react-crossword/src/CrosswordProvider.tsx
index 8d8633c..2ad68a5 100644
--- a/node_modules/@jaredreisinger/react-crossword/src/CrosswordProvider.tsx
+++ b/node_modules/@jaredreisinger/react-crossword/src/CrosswordProvider.tsx
@@ -886,6 +886,9 @@ const CrosswordProvider = React.forwardRef<
           }
 
           setCurrentNumber(cellData[direction] ?? '');
+          if (onClueSelected) {
+            onClueSelected(direction, cellData[direction] ?? '');
+          }
         }
 
         focus();

This issue body was partially generated by patch-package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant