mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-22 19:47:47 +01:00
fix(TGUI): Reverts changes to modal.js
Modal.js had a VOREStation-specific change to allow it to handle text input/the enter key. This was removed in commit ( https://github.com/VOREStation/VOREStation/commit/4b7873210ab17ae404c7d8a2432764e92df27d66 ) This change reverts that change, re-adding the logic for enter/keydown. Fixes ( https://github.com/VOREStation/VOREStation/issues/14982 )
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)}>
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user