refactor(operator): improvements to editing

This commit is contained in:
Carlos Valente
2025-11-11 13:06:26 +01:00
committed by Carlos Valente
parent aaeadd13cf
commit 1f2706a063
5 changed files with 105 additions and 8 deletions
@@ -30,12 +30,12 @@
flex-direction: column;
gap: 0.5rem;
max-height: min(80vh, 600px);
max-height: min(60vh, 600px);
overflow-y: auto;
}
.label {
background-color: var(--user-bg);
background-color: var(--user-bg, $gray-900);
width: fit-content;
padding-inline: 1rem;
}
@@ -1,8 +1,8 @@
import { memo, RefObject, SyntheticEvent } from 'react';
import { useLongPress } from '@mantine/hooks';
import { MILLIS_PER_MINUTE, MILLIS_PER_SECOND } from 'ontime-utils';
import DelayIndicator from '../../../common/components/delay-indicator/DelayIndicator';
import { useLongPress } from '../../../common/hooks/useLongPress';
import { cx, getAccessibleColour } from '../../../common/utils/styleUtils';
import { formatDuration, formatTime, useTimeUntilExpectedStart } from '../../../common/utils/time';
import RunningTime from '../../viewers/common/running-time/RunningTime';
@@ -55,8 +55,10 @@ function OperatorEvent({
* gather behaviour for long press and context menu
*/
const handleLongPress = (event?: SyntheticEvent) => {
// we dont have an event out of useLongPress
event?.preventDefault();
// prevent default if the event is cancelable to avoid browser intervention warnings
if (event && event.cancelable) {
event.preventDefault();
}
if (subscribed) {
onLongPress({ id, cue, subscriptions: subscribed });
}