Merge pull request #6426 from CHOMPStation2/upstream-merge-15064

[MIRROR] Fixes Chemmaster not registering "Enter" key, not renaming bottles and not making multiple bottles
This commit is contained in:
Raeschen
2023-06-21 17:12:44 +02:00
committed by GitHub
2 changed files with 26 additions and 4 deletions
+13 -2
View File
@@ -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 (
<Dimmer>
<Dimmer onKeyDown={handleKeyDown} /* VOREStation edit */>
<div
className={classes(['Modal', className, computeBoxClassName(rest)])}
{...computeBoxProps(rest)}>
+13 -2
View File
@@ -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 (
<Dimmer>
<Dimmer onKeyDown={handleKeyDown} /* VOREStation edit */>
<div
className={classes(['Modal', className, computeBoxClassName(rest)])}
{...computeBoxProps(rest)}>