Skip to content

Commit

Permalink
Merge pull request #425 from carbon-bond/safari-enter
Browse files Browse the repository at this point in the history
一律使用 keyCode == 13 來檢查是否按下 enter
  • Loading branch information
MROS authored Jul 4, 2022
2 parents e13f1aa + c6b709d commit 27e7c0f
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion frontend/app/desktop/src/tsx/board/board_editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export function ForceEditor(props: { value: Force, setValue: React.Dispatch<Reac
<div className={style.suggestedTags}>
<div className={style.question}>建議鍵結標籤</div>
<input {...tag.input_props} onKeyDown={(e: React.KeyboardEvent<HTMLInputElement>) => {
if (e.key == 'Enter') {
if (e.keyCode == 13) {
onAddTag();
}
}}/>
Expand Down
4 changes: 2 additions & 2 deletions frontend/app/desktop/src/tsx/chatroom_panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ function SimpleChatRoomPanel(props: {room: SimpleRoomData}): JSX.Element {

if (extended) {
function onKeyDown(e: React.KeyboardEvent<HTMLInputElement>): void {
if (e.key == 'Enter' && input_props.value.length > 0) {
if (e.keyCode == 13 && input_props.value.length > 0) {
const now = new Date();
if (chat.isExist()) {
window.chat_socket.send_message(chat!.id, input_props.value);
Expand Down Expand Up @@ -440,7 +440,7 @@ function ChannelChatRoomPanel(props: {room: ChannelRoomData}): JSX.Element {
if (extended) {

function onKeyDown(e: React.KeyboardEvent<HTMLInputElement>): void {
if (e.key == 'Enter' && input_props.value.length > 0) {
if (e.keyCode == 13 && input_props.value.length > 0) {
const now = new Date();
addChannelMessage(props.room.id, props.room.channel, new Message(
-1,
Expand Down
4 changes: 2 additions & 2 deletions frontend/app/desktop/src/tsx/header/login_modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function LoginStatus(
return;
}
function onKeyDown(e: React.KeyboardEvent<HTMLInputElement>): void {
if (e.key == 'Enter') {
if (e.keyCode == 13) {
login_request(name.value, password.value);
} else if (e.key == 'Escape') {
props.setLogining(false);
Expand Down Expand Up @@ -151,7 +151,7 @@ export function SignupModal(props: {setSignuping: (signing: boolean) => void}):
props.setSignuping(false);
}
function onKeyDown(e: React.KeyboardEvent<HTMLInputElement>): void {
if (e.key == 'Enter') {
if (e.keyCode == 13) {
signup_request(email.value);
} else if (e.key == 'Escape') {
props.setSignuping(false);
Expand Down
2 changes: 1 addition & 1 deletion frontend/app/desktop/src/tsx/header/search_bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export function SearchBar(props: { cur_board: string | null, hide_select_board?:
setContent(evt.target.value);
}
function onKeyDown(evt: React.KeyboardEvent): void {
if (evt.key == 'Enter') {
if (evt.keyCode == 13) {
onSearch(board);
}
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/app/desktop/src/tsx/setting_page/claim_title.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export function ClaimLawerTitle(props: {setSignuping: (signing: boolean) => void
];

function onKeyDown(e: React.KeyboardEvent<HTMLInputElement>): void {
if (e.key == 'Enter') {
if (e.keyCode == 13) {
handleSearch();
}
}
Expand Down

0 comments on commit 27e7c0f

Please sign in to comment.