mirror of
https://github.com/cpvalente/ontime.git
synced 2026-09-04 22:09:10 +00:00
style: fix input overflow
This commit is contained in:
committed by
Carlos Valente
parent
d0f958c13d
commit
71a7fe96d1
@@ -4,9 +4,7 @@ import { millisToString } from 'ontime-utils';
|
|||||||
|
|
||||||
import { useEmitLog } from '../../../stores/logger';
|
import { useEmitLog } from '../../../stores/logger';
|
||||||
import { forgivingStringToMillis } from '../../../utils/dateConfig';
|
import { forgivingStringToMillis } from '../../../utils/dateConfig';
|
||||||
import { cx } from '../../../utils/styleUtils';
|
|
||||||
|
|
||||||
import style from './TimeInput.module.scss';
|
|
||||||
interface TimeInputProps<T extends string> {
|
interface TimeInputProps<T extends string> {
|
||||||
name: T;
|
name: T;
|
||||||
submitHandler: (field: T, value: string) => void;
|
submitHandler: (field: T, value: string) => void;
|
||||||
@@ -117,15 +115,13 @@ export default function TimeInput<T extends string>(props: TimeInputProps<T>) {
|
|||||||
resetValue();
|
resetValue();
|
||||||
}, [resetValue, time]);
|
}, [resetValue, time]);
|
||||||
|
|
||||||
const timeInputClasses = cx([style.timeInput, className]);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Input
|
<Input
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
size='sm'
|
size='sm'
|
||||||
ref={inputRef}
|
ref={inputRef}
|
||||||
data-testid={`time-input-${name}`}
|
data-testid={`time-input-${name}`}
|
||||||
className={timeInputClasses}
|
className={className}
|
||||||
fontSize='1rem'
|
fontSize='1rem'
|
||||||
type='text'
|
type='text'
|
||||||
placeholder={placeholder}
|
placeholder={placeholder}
|
||||||
@@ -136,7 +132,10 @@ export default function TimeInput<T extends string>(props: TimeInputProps<T>) {
|
|||||||
onKeyDown={onKeyDownHandler}
|
onKeyDown={onKeyDownHandler}
|
||||||
value={value}
|
value={value}
|
||||||
maxLength={8}
|
maxLength={8}
|
||||||
|
maxWidth='7.5em'
|
||||||
|
letterSpacing='1px'
|
||||||
autoComplete='off'
|
autoComplete='off'
|
||||||
|
textAlign='center'
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,5 +8,5 @@ $input-delayed-border-color: $ontime-delay-text;
|
|||||||
}
|
}
|
||||||
|
|
||||||
.inputField {
|
.inputField {
|
||||||
max-width: 7.75em;
|
text-align: left;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user