mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-08-29 16:19:36 +01:00
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:
@@ -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)}>
|
||||
|
||||
@@ -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)}>
|
||||
|
||||
Reference in New Issue
Block a user