Skip to content

Commit

Permalink
Allowing Numpad / Numeric Enter (#248)
Browse files Browse the repository at this point in the history
  • Loading branch information
antoinejaussoin authored Apr 7, 2021
1 parent 58c33ae commit 4ff1474
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ When using the Docker deployment, your database runs from a container. But if yo
- Search now also works with the author's name, if the author is displayed. 👏 Thanks [@ayxos](https://github.com/ayxos) for pointing this out. ([#202](https://github.com/antoinejaussoin/retro-board/issues/202))
- Replacing the reducer logic with Recoil for global state management.
- Adding the possibility of creating a post by clicking on the "return" icon (⮐) instead of hitting "Enter". 👏 Thanks to [@do606](https://github.com/do606) for pointing out that Enter doesn't always seem to work ([#246](https://github.com/antoinejaussoin/retro-board/issues/246)).
- Re-adding the ability of creating a post by hitting Enter on a numeric pad. 👏 Thanks again to [@do606](https://github.com/do606) for that.
- Upgrading dependencies

### Version 4.2.0
Expand Down
6 changes: 5 additions & 1 deletion retro-board-app/src/views/game/board/Column.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const Column: React.FC<ColumnProps> = ({

const handleAddKeyboard = useCallback(
(e: React.KeyboardEvent) => {
if (e.code === 'Enter' && content) {
if (isEnter(e.code) && content) {
handleAdd();
}
},
Expand Down Expand Up @@ -224,6 +224,10 @@ const Column: React.FC<ColumnProps> = ({
);
};

function isEnter(code: string) {
return code === 'Enter' || code === 'NumpadEnter';
}

const ColumnWrapper = styled.div`
display: flex;
flex-direction: column;
Expand Down

0 comments on commit 4ff1474

Please sign in to comment.