From b8ad578a75d1d13b5ce90c162087329acd4ee280 Mon Sep 17 00:00:00 2001 From: Heroman3003 <31296024+Heroman3003@users.noreply.github.com> Date: Wed, 21 Jun 2023 20:31:49 +1000 Subject: [PATCH 1/2] Fixes Chemmaster not registering "Enter" key, not renaming bottles and not making multiple bottles --- tgui/packages/tgui/components/Modal.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/tgui/packages/tgui/components/Modal.js b/tgui/packages/tgui/components/Modal.js index 9cf990c45b..54c8c090ec 100644 --- a/tgui/packages/tgui/components/Modal.js +++ b/tgui/packages/tgui/components/Modal.js @@ -9,9 +9,20 @@ import { computeBoxClassName, computeBoxProps } from './Box'; import { Dimmer } from './Dimmer'; export const Modal = (props) => { - const { className, children, ...rest } = props; + const { className, children, onEnter, ...rest } = props; + // VOREStation Addition start + let handleKeyDown; + if (onEnter) { + handleKeyDown = (e) => { + let key = e.which || e.keyCode; + if (key === 13) { + onEnter(e); + } + }; + } + // VOREStation Addition end return ( - +
From cc1b3d96a661dbf22e83636e44401e9751044ec8 Mon Sep 17 00:00:00 2001 From: Raeschen Date: Wed, 21 Jun 2023 16:42:25 +0200 Subject: [PATCH 2/2] forward change into tgui_ch --- tgui/packages/tgui_ch/components/Modal.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/tgui/packages/tgui_ch/components/Modal.js b/tgui/packages/tgui_ch/components/Modal.js index 9cf990c45b..54c8c090ec 100644 --- a/tgui/packages/tgui_ch/components/Modal.js +++ b/tgui/packages/tgui_ch/components/Modal.js @@ -9,9 +9,20 @@ import { computeBoxClassName, computeBoxProps } from './Box'; import { Dimmer } from './Dimmer'; export const Modal = (props) => { - const { className, children, ...rest } = props; + const { className, children, onEnter, ...rest } = props; + // VOREStation Addition start + let handleKeyDown; + if (onEnter) { + handleKeyDown = (e) => { + let key = e.which || e.keyCode; + if (key === 13) { + onEnter(e); + } + }; + } + // VOREStation Addition end return ( - +